Replies: 1 comment 1 reply
-
|
I'm going to move this to a feature request discussion. IMO, Cookies are inherently different in CSR and SSR due to cookie paths, origins, http only, etc., so I think it's probably better/safer to read from the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of React Router are you using?
6.15.0
Steps to Reproduce
Create a Route with a loader (in CSR) and get
Cookieheader from the request.Expected Behavior
I expect cookies to be available through the
Cookieheader (as theyaremight be in SSR) so I can use the same piece of code for both CSR and SSR.Actual Behavior
The cookies are not available in the
Cookieheader.Analyzing the
createClientSideRequestfunction inreact-router/packages/router/router.ts, it looks like the cookies (fromdocument.cookie) are not included in theRequestcreated:Notes
It might be a feature request but since it's available in SSR, I expect the same behavior in CSR.
Beta Was this translation helpful? Give feedback.
All reactions