Skip to content
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

Unable to setCookie, when name starting with "/" #704

Open
skbhardwaj opened this issue Oct 14, 2024 · 1 comment
Open

Unable to setCookie, when name starting with "/" #704

skbhardwaj opened this issue Oct 14, 2024 · 1 comment

Comments

@skbhardwaj
Copy link

Hi,

I tried to set cookie with starting character "/", unfortunately its generating "TypeError: argument name is invalid".

CSB link - https://codesandbox.io/p/devbox/react-cookie-setcookie-issue-k8wc4x?file=%2Fapp%2Fpage.tsx%3A24%2C8

Am i missing something?

Thanks & kind regards,

@skbhardwaj skbhardwaj changed the title Unable to set cookie starting with "/" Unable to setCookie, when name starting with "/" Oct 15, 2024
@ollylowe
Copy link

ollylowe commented Dec 5, 2024

The underlying "cookies" dependency had it's cookie name regex updated in this PR: jshttp/cookie#167. It removed "/" as a valid character in cookie names. Personally I'd consider this a breaking change, but it was not documented as such and released as part of 0.7.0 (https://github.com/jshttp/cookie/releases/tag/v0.7.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants