Quantcast
Channel: User Thomas - Stack Overflow
Viewing all articles
Browse latest Browse all 39

Session lifetime in node.js with express and MongoDB

$
0
0

I am using node.js with the express framework. As a session store I am using MongoDB. How can I set the lifetime after which the session objects are removed from MongoDB. This is how I am doing the declaration:

app.use(express.cookieParser());    app.use(express.session({                secret: "Stays my secret",                store: new MongoStore({ db: 'myDB' })                    }));

Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>