Xerri
Xerri

Reputation: 5046

Express.JS: Logout without destroying the session

I have an Express.js application and I would like to keep a log of all the sessions by the users. This has created a bit of trouble while implementing the Logout feature. The accepted practice is to use session.destroy but I do not want to do this since it deletes the session from the database. Is it possible to expire the session without destroying it?

Upvotes: 1

Views: 332

Answers (1)

Krasimir
Krasimir

Reputation: 13529

Why don't you use some key in the session. For example:

req.session.date = "...";

Upvotes: 1

Related Questions