The following code is causing all of the cookie parameters to be removed from the Set-Cookie header when the cookie is initially set by express-sessions.
|
if(session.cookie && session.cookie.toJSON) { |
|
session.cookie = session.cookie.toJSON(); |
|
} |
By turning the cookie object into a normal JSON object all of the computed properties on the object are lost. This causes an issue in express-sessions since it uses the computed data property to fill in the Set-Cookie header.
Ref: the data property
https://github.com/expressjs/session/blob/e18fb51d2d403bf3b5bd4e498f621dee4a52db41/session/cookie.js#L117-L127
Ref: where the data property is being used
https://github.com/expressjs/session/blob/e18fb51d2d403bf3b5bd4e498f621dee4a52db41/index.js#L243
The following code is causing all of the cookie parameters to be removed from the Set-Cookie header when the cookie is initially set by express-sessions.
session-pouchdb-store/lib/store.js
Lines 215 to 217 in 6f9845f
By turning the cookie object into a normal JSON object all of the computed properties on the object are lost. This causes an issue in express-sessions since it uses the computed
dataproperty to fill in the Set-Cookie header.Ref: the data property
https://github.com/expressjs/session/blob/e18fb51d2d403bf3b5bd4e498f621dee4a52db41/session/cookie.js#L117-L127
Ref: where the data property is being used
https://github.com/expressjs/session/blob/e18fb51d2d403bf3b5bd4e498f621dee4a52db41/index.js#L243