How to store session values with Node.js and mongodb? How to store session values with Node.js and mongodb? mongodb mongodb

How to store session values with Node.js and mongodb?


Take a look at this series from DailyJS. It uses MongoDB and session management

http://dailyjs.com/tags.html#lmawa


I am not experienced with Node.js or Express, so I cannot immediately see what's wrong with your approach. However, I have made Express use MongoDB to store sessions for flash messages and other session stuff.

You can see my source code for a simple URL shortener here (that actually makes the URLs pretty long at the moment - it was just an exercise ;)). I use the session to store a list of URLs that the current user has shortened.

It is not pretty, but I know it works.