-
Notifications
You must be signed in to change notification settings - Fork 129
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
Set cookies #382
Comments
Checking the |
Yes it works fine in browser and in Postman |
I also have the same problem, the application runs fine locally but when deployed to Firebase it cannot get cookies 😥 |
Try with const loginResponse = await ofetch.raw('/login', {
method: 'POST',
body: {
email: '[email protected]',
password: 'test123',
},
credentials: "include",
}); |
You mean |
Yeah my bad, did you try it with |
It works in the browser and with Postman, just not in the test or an empty node script with ofetch. |
Facing the same issue, runs fine locally but not in production. Did anyone figure this out? :( |
What you are trying to accomplish is creating a stateful client, which shares state between subsequent requests. I imagine using fetch-cookie package with import { $fetch } from 'ofetch'
import makeFetchCookie from 'fetch-cookie'
const fetchWithCookies = makeFetchCookie($fetch.native)
const client = $fetch.create({ fetch: fetchWithCookies }) |
Thanks for the info! Can we treat this issue as a feature request then? So |
After many days of researching, I also found the problem. Firebase only accepts one cookie named __session. Hope this information is useful to everyone. Details on this can be found here: https://firebase.google.com/docs/hosting/manage-cache?hl=en#using_cookies |
Describe the feature
I have a login route that returns a session cookie but when sending subsequents requests the cookie is not set:
Unfortunately the cookie is never set. I tried to set option
credentials: 'include'
on both requests with no success. Am I missing something?Additional information
The text was updated successfully, but these errors were encountered: