Skip to content

Commit

Permalink
Update maxAge of cookie to reflect time in milliseconds (#1)
Browse files Browse the repository at this point in the history
maxAge is in milliseconds. The value was missing a multiplication that made the cookie expire after about 15 minute and not 10 day, as I believe the author intended. This was felt mainly on mobile devices where the browser closes frequently.
  • Loading branch information
jankei authored Jun 21, 2017
1 parent c925a2c commit 3b983d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function signinWithUser (user, req, res, onSuccess) {
var cookieOpts = _.defaults({}, keystone.get('cookie signin options'), {
signed: true,
httpOnly: true,
maxAge: 10 * 24 * 60 * 60,
maxAge: 10 * 24 * 60 * 60 * 1000,
});
res.cookie('keystone.uid', userToken, cookieOpts);
}
Expand Down

0 comments on commit 3b983d7

Please sign in to comment.