Monday, 12 June 2017

node sessions not clearing in production

I am using client-sessions with node and express, and I am having trouble logging out users.

my logout function does a

req.session.user=null 

that is:

userRouter.get('/logout', function(req, res, next) {
  req.session.user = null
res.sendStatus(200)
});

(I also tried delete req.user, req.user.destroy(), and other variants).

in dev env, on localhost, it works great. in production environment, logout is called, but the next time the user refreshes the page on the browser, the user is still logged in.

same code in dev and production.

Anybody has any idea? thanks....



via Fab

No comments:

Post a Comment