Cookie session wouldn't keep data unless using Incognito Window in Chrome
alvarotrigo opened this issue · comments
I had this problem a couple of times before. It seems to take place only from time to time.
The session wouldn't keep the data on a redirect
unless I did the same action on an Incognito Window using Chrome. (Or incognito window in any other browser).
The exact same code was working properly in Incognito as well as in production.
Only after I went to Chrome Developer Tools and click on Application / Clear Storage / Select all boxes / Clear selected
, I was able to get the cookie session to be shared around my app.
Notice, this was not working even after removing manually the Local Storage
,Session Storage
and Cookies
from the left panel.
req.session.user = {
test: 'test'
};
//req. session.user would be `undefined` after this unless in incognito
res.redirect('/');
Am I doing anything wrong? What am I missing?
Why the same code works ok in other computer or in incognito?
That is very weird. Is it possible to share the following so I can poke at it?
- Version of Node.js and this module
- Code to run that reproduces this
- Some instructions on what to load / browse in the browser to reproduce
I'm only asking because I have no ideas off-hand, so wanted to poke at it to see if I could come up with something.
Closing since I never heard back.
I'm actually having a similar issue, but with a PHPSESSID from PHP, not related to expressJS, so I guess its something in chrome... Just dont know what :(
It doesn't save the PHPSESSID in a regular browser, but it does in an ingocnito window. Very odd.
EDIT: 100% the same as you described by the way.