Skip to content

Instantly share code, notes, and snippets.

@artcommacode
Created June 25, 2014 12:44
Show Gist options
  • Save artcommacode/c5309ed4a82871c4e46b to your computer and use it in GitHub Desktop.
Save artcommacode/c5309ed4a82871c4e46b to your computer and use it in GitHub Desktop.
var session = require('express-session')
, config = require('../config')
, mongoStore = require('connect-mongo')({session: session});
module.exports = function() {
return session({
secret: config.sessions.secret,
store: new mongoStore({
url: config.db.url,
collection : config.sessions.collection
}),
cookie: {
maxAge: 1000*60*60*24*30
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment