From 33f07b82f99f60d9b48689601b5cf4dc1f37bc92 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 23 Nov 2015 11:59:00 -0500 Subject: [PATCH] closes #3893 --- src/controllers/authentication.js | 2 +- src/middleware/index.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 579f8462c3..1f5d049dc3 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -155,7 +155,7 @@ function continueLogin(req, res, next) { // Alter user cookie depending on passed-in option if (req.body.remember === 'on') { - var duration = 1000*60*60*24*parseInt(meta.config.loginDays || 14, 10); + var duration = 1000 * 60 * 60 * 24 * (parseInt(meta.config.loginDays, 10) || 14); req.session.cookie.maxAge = duration; req.session.cookie.expires = new Date(Date.now() + duration); } else { diff --git a/src/middleware/index.js b/src/middleware/index.js index 80b6677970..e61bae0afe 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -6,9 +6,7 @@ var meta = require('../meta'), auth = require('../routes/authentication'), path = require('path'), - fs = require('fs'), nconf = require('nconf'), - winston = require('winston'), flash = require('connect-flash'), templates = require('templates.js'), bodyParser = require('body-parser'), @@ -51,7 +49,7 @@ module.exports = function(app) { app.use(cookieParser()); var cookie = { - maxAge: 1000 * 60 * 60 * 24 * parseInt(meta.config.loginDays || 14, 10) + maxAge: 1000 * 60 * 60 * 24 * (parseInt(meta.config.loginDays, 10) || 14) }; if (meta.config.cookieDomain) {