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

Commit

Permalink
Merge pull request #804 from lirantal/feature/session-expiration-enha…
Browse files Browse the repository at this point in the history
…ncement-2

Adding support for configurable session expiration time
  • Loading branch information
lirantal committed Aug 14, 2015
2 parents d9a8647 + 0aa5e68 commit 84926ab
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 84926ab

Please sign in to comment.