Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Adding support for configurable session expiration time
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Aug 14, 2015
1 parent d9a8647 commit 0aa5e68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/env/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions config/lib/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0aa5e68

Please sign in to comment.