I have problem with my simple NodeJS app. I am using connect
with express-session
module.
module.exports.logout = function (request, response, next) {
if (request.session.user) {
request.session.destroy(function (error) {
next(error);
});
}
response.writeHead(301, 'Please login', { 'Location': 'login' });
response.end();
};
The problem is logout page. Whan I run app and firstly logout user i works fine, but when I login second time and logout it only redirect to login page without logout user. I think the problem is because browser use cache for redirects. How to force it?