Skip to content

NextJS 14 + Framework hosting: __session cookie not set when deployed #6893

@vojdan

Description

@vojdan

[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
Screenshot 2024-03-19 at 11 06 21 PM

Screenshot 2024-03-19 at 11 06 39 PM Screenshot 2024-03-19 at 11 06 53 PM

When running the same code on Firebase Hosting no __session cookie is set
Screenshot 2024-03-19 at 11 12 03 PM

[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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions