diff --git a/lib/web/cookies/index.js b/lib/web/cookies/index.js index a612ca86f73..ccfc65a7687 100644 --- a/lib/web/cookies/index.js +++ b/lib/web/cookies/index.js @@ -52,9 +52,14 @@ function getCookies (headers) { } for (const piece of cookie.split(';')) { - const [name, ...value] = piece.split('=') - - out[name.trim()] = value.join('=') + // The name ends at the first '=', and the value keeps any later ones. + const index = piece.indexOf('=') + + if (index === -1) { + out[piece.trim()] = '' + } else { + out[piece.slice(0, index).trim()] = piece.slice(index + 1) + } } return out