Skip to content

Node.js based forum software built for the modern web

closes #5600

barisusakli9f8d80e3a487
diff --git a/src/database/mongo.js b/src/database/mongo.js
index 91b41306f1..ae2ff77856 100644
--- a/src/database/mongo.js
+++ b/src/database/mongo.js
@@ -116,9 +116,9 @@
var meta = require('../meta');
var sessionStore;
- var ttlDays = 1000 * 60 * 60 * 24 * (parseInt(meta.config.loginDays, 10) || 0);
- var ttlSeconds = 1000 * (parseInt(meta.config.loginSeconds, 10) || 0);
- var ttl = ttlSeconds || ttlDays || 1209600000; // Default to 14 days
+ var ttlDays = 60 * 60 * 24 * (parseInt(meta.config.loginDays, 10) || 0);
+ var ttlSeconds = (parseInt(meta.config.loginSeconds, 10) || 0);
+ var ttl = ttlSeconds || ttlDays || 1209600; // Default to 14 days in seconds
if (nconf.get('redis')) {
sessionStore = require('connect-redis')(session);