Skip to content

Instantly share code, notes, and snippets.

@kconragan
Created May 14, 2012 00:14
Show Gist options
  • Save kconragan/2690877 to your computer and use it in GitHub Desktop.
Save kconragan/2690877 to your computer and use it in GitHub Desktop.
Example of using connect-mongo for session management with a single db
app.use(express.session({
secret:'awesome unicorns',
maxAge: new Date(Date.now() + 3600000),
store: new MongoStore({
db:mongoose.connection.db},
function(err){
console.log(err || 'connect-mongodb setup ok');
})
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment