Skip to content Skip to sidebar Skip to footer

Req.session.passport Is Empty: Req.user Undefined

I've asked a similar question before, but I noticed it was in the Javascript section. I have more specific ideas of what might be going wrong now, as well. Basically, req.session.p

Solution 1:

The problem was not anything I did wrong in setting up the session, or Passport in general, but rather in my links. I read somewhere that someone was accidentally working in multiple domains (his platform was apparently multi-server), and that made me look through my links this morning.

Apparently, I was linking to my website with www. prefixed, but the session was initialized where there was no www. in front of the URL. I saw this in the cookies. The solution was, therefore, to link through the website consistently, either having www. prefixed everywhere or nowhere.

Post a Comment for "Req.session.passport Is Empty: Req.user Undefined"