Skip to content

Error reading a cookie set with document.cookie in loaders #12725

Discussion options

You must be logged in to vote

@vniehues, I am not sure why but I basically, changed the cookie name from sidebar:state to just sidebar in the sidebar component and this worked. It looks like the cookie set on the document having the name with a colon in it was the issue? Could it be a bug in react router reading the cookie from the request headers or parsing of the cookie? I did read that the HTTP Cookie Specification (RFC 6265) does not explicitly ban the use of colons in cookie names but some servers, browsers and frameworks might have compatibility issues.

I tried to actually create a react router cookie with the createCookie function that uses a colon in the cookie name and that did work though so it could be comp…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@discoverlance-com
Comment options

Comment options

You must be logged in to vote
3 replies
@discoverlance-com
Comment options

@discoverlance-com
Comment options

Answer selected by discoverlance-com
@vniehues
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants