I am wondering how to implement the logout function in nodejs using express and express section, the code I wrote is following:
app.get('/logout',function(req, res){
req.session.destroy(function(){
res.redirect('/');
});
});
However, when multiple user login, if one of the user logout, everyone else that login will be log out. Can anyone please tell me how to implement this correctly? thanks :)
NVM, I found out that the problem can be resolve by using the destroy(sid, fn) method in session-memory module
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