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
-
What version of React Router are you using?
6.15.0
Steps to Reproduce
Create a Route with a loader (in CSR) and get
Cookie
header from the request.Expected Behavior
I expect cookies to be available through the
Cookie
header (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
Cookie
header.Analyzing the
createClientSideRequest
function inreact-router/packages/router/router.ts
, it looks like the cookies (fromdocument.cookie
) are not included in theRequest
created: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