Merge pull request #804 from lirantal/feature/session-expiration-enhancement-2

Adding support for configurable session expiration time
This commit is contained in:
Liran Tal
2015-08-14 16:30:20 +03:00
2 changed files with 5 additions and 0 deletions

View File

@@ -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

View File

@@ -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,