2

I'm using express.js cookie-session in order to store my logged user session. Each time I'm signing in new user I'm putting a userId on his current session and assigning this userId to a user._id I created for him on my DB:

req.session.userId = user._id;

Eventually when a new user will submit my login form, a get request will be sent to my /user restful service containing my user data and if that data (identifier) isn't store on my DB a new user will be registered on my DB and a new session cookie will be created for him.

req.session.userId = user._id;
res.status(200).send({'userId': user._id});

I tested the above functionality on chrome, firefox and IE11 When using chrome/firefox the response code after login is 200 and the submitted user is being greeted by the UI. However when using IE11 The first submitted user will be greeted by the UI but when another user is submitted he won't be greeted, apparently IE11 caches the first logged in session-cookie (response code 304), unless turning on a flag in dev console which is always refresh from server, but this is not the browser's default option.

4

0 回答 0