I am currently developing a PWA using Next.js and iron-session, and I am testing it locally with HTTPS using mkcert. While testing authentication, I encountered an issue specific to Safari.
Issue:
- In Google Chrome, when I manually add a
sessionKey
cookie via the developer console and refresh the page, iron-session successfully recognizes the cookie and logs me in. - However, in Safari, even after adding the same
sessionKey
cookie manually in the developer console, refreshing the page does not log me in. It seems like iron-session does not recognize the cookie.
Environment:
- Framework: Next.js (latest)
- Session Library: iron-session
- HTTPS Setup: Using mkcert for local HTTPS (
https://localhost:3000
) - Browsers Tested:
- ✅ Chrome: Works fine (manually added cookie is recognized)
- ❌ Safari: Manually added cookie is not recognized