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 sessionKey configuration parameter to allow to eas…
Browse files Browse the repository at this point in the history
…ily change the session key that is used to hold the session value. The default is a generic sessionId key to introduce security through obscurity.
  • Loading branch information
lirantal committed Aug 13, 2015
1 parent 21f1f4e commit 360c3a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/env/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ module.exports = {
},
port: process.env.PORT || 3000,
templateEngine: 'swig',
// Session details
// sessionSecret should be changed for security measures and concerns
sessionSecret: 'MEAN',
// sessionKey is set to the generic sessionId key used by PHP applications
// for obsecurity reasons
sessionKey: 'sessionId',
sessionCollection: 'sessions',
logo: 'modules/core/img/brand/logo.png',
favicon: 'modules/core/img/brand/favicon.ico'
Expand Down
1 change: 1 addition & 0 deletions config/lib/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ module.exports.initSession = function (app, db) {
saveUninitialized: true,
resave: true,
secret: config.sessionSecret,
key: config.sessionKey,
store: new MongoStore({
mongooseConnection: db.connection,
collection: config.sessionCollection
Expand Down

0 comments on commit 360c3a4

Please sign in to comment.