Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a note about cookies in documentation #205

Open
axel-rock opened this issue Jan 30, 2023 · 1 comment
Open

feat: Add a note about cookies in documentation #205

axel-rock opened this issue Jan 30, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@axel-rock
Copy link

Describe the problem

I suggest adding a word about cookies.

This is not per say a svelte-adapter-firebase issue, but it took me days of investigating why my cookies were working locally, but not live.

The solution was fairly simple, but buried deep inside Firebase's documentation.

Describe the proposed solution

Write a short paragraph under Caveats about the single cookie name that's allowed to be passed to your SSR function, and it is: __session

It is documented here: https://firebase.google.com/docs/hosting/manage-cache#using_cookies

Copy suggestion:

Cookies: When using Firebase Hosting together with Cloud Functions, cookies are stripped from incoming requests. Only the specially-named __session cookie is permitted to pass through to the execution of your app. Source: Firebase documentation

Alternatives considered

One even greater alternative would be to trigger a warning in the console when trying to access an other cookie from the server. I managed to get some cookies across in some occasions, not sure if it's worth implementing.

Importance

would make my life easier

@axel-rock axel-rock added the enhancement New feature or request label Jan 30, 2023
@axel-rock axel-rock changed the title feat: feat: Add a note about cookies in documentation Jan 30, 2023
@troelsmunk
Copy link

I agree that it's not really an issue for this adapter, and more something you have to know about Firebase CDN.
But still, thanks for pointing it out @axel-rock. This solved the flakiness of my cookies in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants