-
Notifications
You must be signed in to change notification settings - Fork 286
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
Fetching during SSR (using Next) should include cookies #141
Comments
Are you sure? This is a very common use case. I believe |
@matthew-andrews in discussions with the Next people, one said "I have the same problem with isomorphic-fetch", and another said "You'll have to manually pass the cookies off (reading from req) and pass them to axios / isomorphic-fetch" Any idea how I "pass the cookies" to isomorphic-fetch?
|
Oh right, on the server, I see…… I think you'd need to add the cookie header manually in that environment. Something like this… fetch(url, {
headers: { Cookie: 'name=value' }
}); |
on the server, isomorphic-fetch just proxies node-fetch underneath, which as you say does not implement |
Cookies are included in the Express routing when the fetch code runs on the browser, but when run during SSR with Next, the cookies are not available. I'd expect them to be.
Adding
credentials: 'same-origin'
orcredentials: 'include'
to the fetch options did not make a difference.The text was updated successfully, but these errors were encountered: