mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-06 19:45:45 +02:00
Merge pull request #804 from lirantal/feature/session-expiration-enhancement-2
Adding support for configurable session expiration time
This commit is contained in:
2
config/env/default.js
vendored
2
config/env/default.js
vendored
@@ -10,6 +10,8 @@ module.exports = {
|
||||
port: process.env.PORT || 3000,
|
||||
templateEngine: 'swig',
|
||||
// Session details
|
||||
// session expiration is set by default to 24 hours
|
||||
sessionExpiration: 24 * (60 * 1000),
|
||||
// sessionSecret should be changed for security measures and concerns
|
||||
sessionSecret: 'MEAN',
|
||||
// sessionKey is set to the generic sessionId key used by PHP applications
|
||||
|
||||
@@ -115,6 +115,9 @@ module.exports.initSession = function (app, db) {
|
||||
saveUninitialized: true,
|
||||
resave: true,
|
||||
secret: config.sessionSecret,
|
||||
cookie: {
|
||||
maxAge: config.sessionExpiration
|
||||
},
|
||||
key: config.sessionKey,
|
||||
store: new MongoStore({
|
||||
mongooseConnection: db.connection,
|
||||
|
||||
Reference in New Issue
Block a user