Relative Content

Tag Archive for expresssession-cookies

Req.session get undefined on Expressjs server when deploying the frontend and backend with vercel

I’m trying to implement authentication, I store JWT token in session and send it with every request and I use cookie-session. All worked fine on localhost, but when I deploy my app with vercel, the server can only receive an undefined req.session. The browser told me that my session don’t have sameSite attribute, so it sets to default value – lax. but apparently, I had already set that in my server.
This is the code of my express server: