We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.13.0
// const cookies = request.headers.get("Cookie") ?? ""; // to reproduce, this the header string: const cookies = "inspectorSessionId=ctinspectorlogin; __stripe_mid=79bda20b-3e18-405b-8db6-2d7829fce613d27550; team=a; uuid=63e90dfdf255f; contributorId=c08fb47c-c438-4cb9-b3fe-3214d4437d39; loginSessionId=a0116336-488d-4ecd-9555-ba99f6e1d7da; organizationId=cld98h5jd0000zqm85wvj7wev"; const loginSessionId = (await createCookie("loginSessionId").parse(cookies)) ?? ""; console.log(loginSessionId); // gives {} instead of "a0116336-488d-4ecd-9555-ba99f6e1d7da"
Is it a particular problem with this header string?
The cookie.parse() function should return the cookie string from the header, or at least null if not found. Not {}.
cookie.parse()
null
{}
The cookie.parse() function returns an empty object {} instead of null or the actual value of the cookie.
The text was updated successfully, but these errors were encountered:
@xriter I ran into this today and it seems that "cookie must be base64 encoded if you want the Remix cookie utils to parse it" according to this Remix discord discussion: https://discord.com/channels/770287896669978684/1070450652049834159/1070460981207117897
In my case, I want to read a cookie that has been set by the client and couldn't do so using cookie.parse https://remix.run/docs/en/main/utils/cookies#md-cookieparse (which is confusing IMO)
cookie.parse
Here's the source code: https://github.com/remix-run/remix/blob/main/packages/remix-server-runtime/cookies.ts#L180
Sorry, something went wrong.
fix: Text content did not match (Hydration Error)
cf29270
cookie.parse method seems to only accept base64 encode values see remix-run/remix#5523 (comment)
fix: Text content did not match (Hydration Error) (#1267)
f3fdda5
No branches or pull requests
What version of Remix are you using?
1.13.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Is it a particular problem with this header string?
Expected Behavior
The
cookie.parse()
function should return the cookie string from the header, or at leastnull
if not found. Not{}
.Actual Behavior
The
cookie.parse()
function returns an empty object{}
instead ofnull
or the actual value of the cookie.The text was updated successfully, but these errors were encountered: