firebase / firebase/firebase-tools
NextJS 14 + Framework hosting: __session cookie not set when deployed
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
### [REQUIRED] Environment info
**firebase-tools:** 13.5.1
**Platform:** macOS
### [REQUIRED] Test case
```
"firebase": "^10.9.0",
"firebase-admin": "^12.0.0",
"next": "14.1.2",
```
Logging with link auth working locally and deployed, but the `__session` cookie is not set when the application is deployed. When running locally the cookie gets set.
Sample network requests when running locally shows the __session cookie being set automatically after login
When running the same code on Firebase Hosting no __session cookie is set
### [REQUIRED] Steps to reproduce
Deploy to Firebase Hosting.
Login with link.
Inspect network requets.
Refresh.
### [REQUIRED] Expected behavior
The user should be set by SSR. The session should be available in the `__session` cookie.
### [REQUIRED] Actual behavior
When deployed to firebase Hosting, the user is not set in SSR due to the `__session` cookie not being set. The user state is signed out on page load and the page updates after connecting to Firebase to show the user info.
Contributor guide
Assessment
This issue has not been assessed yet.