Last active
November 29, 2018 20:20
-
-
Save max8hine/f237ea14c0f07a8cefbd295bfca96f2a to your computer and use it in GitHub Desktop.
req.session and cookie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/jdesboeufs/connect-mongo#readme | |
// https://docs.mongodb.com/manual/tutorial/expire-data/ | |
/* A session cookie is just a normal cookie without an expiration date. | |
Those are handled by the browser to be valid until the window is closed or program is quit. | |
But if the cookie is a httpOnly cookie (a cookie with the httpOnly parameter set), | |
you cannot read, change or delete it from outside of HTTP (meaning it must be changed on the server). */ | |
cookie: { originalMaxAge: null, expires: null, httpOnly: true, path: '/' } | |
cookie: { path: '/', _expires: 2018-12-09T10:13:33.883Z, originalMaxAge: 864000000, httpOnly: true } | |
// ===== | |
// https://stackoverflow.com/questions/21764563/connect-mongo-expiration-time | |
// https://github.com/jdesboeufs/connect-mongo/issues/46 | |
/* | |
https://www.npmjs.com/package/express-session | |
https://github.com/keystonejs/keystone/issues/4494 | |
Settings object for the session ID cookie. The default value is { path: '/', httpOnly: true, secure: false, maxAge: null }. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment