Fixed _removeSessionCookie method use of cookies

refs https://github.com/TryGhost/Team/issues/908

The `cookies` module will unset a cookie if `null` or `undefined` is
passed as the value, or if the value is not passed. The previous call
was passing the options, which were being read as the value, and
resulting in `'[Object object]'` being stored as a cookie.

Explicitly passing `null` as the value makes this code correct and
easier to maintain.
This commit is contained in:
Fabien O'Carroll 2021-07-20 10:13:21 +01:00 committed by Fabien 'egg' O'Carroll
parent 5fc0646d5e
commit ae9bad957b

View File

@ -108,7 +108,7 @@ class MembersSSR {
*/
_removeSessionCookie(req, res) {
const cookies = this._getCookies(req, res);
cookies.set(this.sessionCookieName, this.sessionCookieOptions);
cookies.set(this.sessionCookieName, null, this.sessionCookieOptions);
}
/**