v1.18.x
barisusakli 9 years ago
parent ecd777b659
commit 33f07b82f9

@ -155,7 +155,7 @@ function continueLogin(req, res, next) {
// Alter user cookie depending on passed-in option // Alter user cookie depending on passed-in option
if (req.body.remember === 'on') { 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.maxAge = duration;
req.session.cookie.expires = new Date(Date.now() + duration); req.session.cookie.expires = new Date(Date.now() + duration);
} else { } else {

@ -6,9 +6,7 @@ var meta = require('../meta'),
auth = require('../routes/authentication'), auth = require('../routes/authentication'),
path = require('path'), path = require('path'),
fs = require('fs'),
nconf = require('nconf'), nconf = require('nconf'),
winston = require('winston'),
flash = require('connect-flash'), flash = require('connect-flash'),
templates = require('templates.js'), templates = require('templates.js'),
bodyParser = require('body-parser'), bodyParser = require('body-parser'),
@ -51,7 +49,7 @@ module.exports = function(app) {
app.use(cookieParser()); app.use(cookieParser());
var cookie = { 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) { if (meta.config.cookieDomain) {

Loading…
Cancel
Save