Created
May 14, 2012 00:14
-
-
Save kconragan/2690877 to your computer and use it in GitHub Desktop.
Example of using connect-mongo for session management with a single db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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