Tuesday, 8 September 2020

Express-Session not creating a session (MERN Project)

This is my first time using Express-session with React, and I'm a beginner anyway. So this is my current code:https://imgur.com/a/TGGzjcU (Front end: Port 3000, Backend: port 5000)I was under the impression that a session starts (i.e. the session DB entry is created) when the first HTTP request sent to the backend. So, I am sending a request after the main (App) component of my frontend gets mounted. Still, the database "session" collection is empty (the collection itself is created though), and no cookies are being set on the browser. What am I doing wrong?Thanks.

Submitted September 09, 2020 at 06:47AM by NecroDeity

No comments:

Post a Comment