Skip to content

Commit

Permalink
fix(sessions): define maxAge in the cookie property (#210)
Browse files Browse the repository at this point in the history
In #209, I re-introduced cookie expiration using express-session's maxAge property, but had defined it at the wrong path of the settings object.

Now defined in cookie.maxAge instead of just maxAge.
  • Loading branch information
adrienjoly committed Jul 14, 2019
1 parent 0742955 commit 6d3ffbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ function start() {
store: new MongoStore({
url: makeMongoUrl(params)
}),
cookie: {
maxAge: 365 * 24 * 60 * 60 * 1000 // cookies expire in 1 year (provided in milliseconds)
},
name: 'whydSid',
maxAge: 365 * 24 * 60 * 60 * 1000, // cookies expire in 1 year (provided in milliseconds)
resave: false, // required, cf https://www.npmjs.com/package/express-session#resave
saveUninitialized: false // required, cf https://www.npmjs.com/package/express-session#saveuninitialized
});
Expand Down

0 comments on commit 6d3ffbb

Please sign in to comment.