From 3b983d7305aaefd4b9f88b3ff0fa4e1eff588a31 Mon Sep 17 00:00:00 2001 From: Yaniv Keinan Date: Wed, 21 Jun 2017 16:02:43 +0300 Subject: [PATCH] Update maxAge of cookie to reflect time in milliseconds (#1) 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. --- lib/session.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/session.js b/lib/session.js index 769c9e279a..a39971c6a2 100644 --- a/lib/session.js +++ b/lib/session.js @@ -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); }