Send them to the logout page instead of redirecting them or put a timeout in the callback.
logout: function(req, res) {
req.session.destroy(function(err) {
return res.view('/logout');
});
}
or
logout: function(req, res) {
req.session.destroy(function(err) {
timeout(function(){
return res.redirect('/');
}, 1000);
});
}
source
share