diff --git a/src/modules/processing/cookie/cookie.js b/src/modules/processing/cookie/cookie.js index 996ab7c7..6dd95fc3 100644 --- a/src/modules/processing/cookie/cookie.js +++ b/src/modules/processing/cookie/cookie.js @@ -20,13 +20,13 @@ export default class Cookie { str.split('; ').forEach(cookie => { const key = cookie.split('=')[0]; const value = cookie.split('=').splice(1).join('='); - obj[key] = decodeURIComponent(value) + obj[key] = value }) return new Cookie(obj) } toString() { - return Object.entries(this._values).map(([ name, value ]) => `${name}=${encodeURIComponent(value)}`).join('; ') + return Object.entries(this._values).map(([ name, value ]) => `${name}=${value}`).join('; ') } toJSON() { return this.toString() diff --git a/src/modules/processing/cookie/manager.js b/src/modules/processing/cookie/manager.js index 4efb0b45..b9feedc1 100644 --- a/src/modules/processing/cookie/manager.js +++ b/src/modules/processing/cookie/manager.js @@ -49,8 +49,10 @@ export function getCookie(service) { export function updateCookie(cookie, headers) { if (!cookie) return; - const parsed = parseSetCookie(splitCookiesString(headers.get('set-cookie'))), - values = {} + const parsed = parseSetCookie( + splitCookiesString(headers.get('set-cookie')), + { decodeValues: false } + ), values = {} cookie.unset(parsed.filter(c => c.expires < new Date()).map(c => c.name)); parsed.filter(c => c.expires > new Date()).forEach(c => values[c.name] = c.value);