Google chrome session expire = null not working

According to the connect documentation , the session should expire when the browser is closed:

By default, cookie.maxAge is null , which means that the "expires" parameter is not set, so the cookie becomes a browser cookie. When the user closes the browser cookie (and the session) will be deleted.

I use express 3 with connect-mysql for session storage (I tried the same one with connect-mongo too) and this is how I set up the session data.

  req.session.userid = results[0].id; req.session.ip = req.connection.remoteAddress; req.session.useragent = req.headers['user-agent']; req.session.is_logged_in = true; 

Everything works fine, except for the Chrome browser browser for any reason (this is not possible in OS X Lion.I now for testing under win or linux).

Has anyone had this problem in google chrome and know how to fix it?

+4
source share
1 answer

This is a pretty wild guess, but I won’t be surprised if this is so. Google Chrome will run in the background if you have extensions that use this. If this case after exiting the log in a session, the session should be reset.

If this is not the case, could you open the developer tools ( cmd+alt+i ) and copy all the information about the cookie ( resources β†’ cookies β†’ yourdomain.com ). (Especially what is written in the Expires column, because Session should say)

+2
source

All Articles