If I am using client-sessions in NodeJS and wish to completely remove a session, how do I go about doing so? It seems that calling reset() just clears the session contents, effectively issuing a new session and updating the cookie with a new, extended expiry.
In this case, I wish to remove the session cookie altogether under certain circumstances (logout, etc.). Does anyone have any tips on how to do so?
In a router like so...
router.get('/logout', function (req, res, next) {
var session = require('client-sessions');
req.session.reset();
res.redirect('/login');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With