Help with Middleware Session Cookie (Development vs Production)
Hey everyone! I’m running into an issue with my middleware, and I can’t quite figure out what’s causing it. The problem occurs when switching from the development environment to production.
Here’s the scenario:
In Development: The
In Production: After logging in, the session cookie is always
Here’s the code I’m working with:
What I’ve tried so far:
Here’s the scenario:
In Development: The
getSessionCookie function returns the session cookie as expected.In Production: After logging in, the session cookie is always
null.Here’s the code I’m working with:
What I’ve tried so far:
- Verified that cookies are being set correctly in production.
- Checked that the environment variables and configurations match between dev and production.
- Tried logging the
sessionCookieto see if there's any difference, but it still comes up as
in production.null