Getting Started With Node – Course

Session

We can handle session in Express using express-session middleware. We can use this middleware to create, track and delete sessions.

Installation

npm install --save express-session

To use this module in our code, load this as a middleware.

app.use(session({secret: 'some secrets'}));

Now, we can use req.session object to create, track and delete session.

To learn more about the session, please read this article.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.