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
When I set a cookie with domain example.com from foo.example.com the domain of the cookie is being set to .example.com.
example.com
foo.example.com
.example.com
Cookies.set('mycookie', 'myvalue', {domain: 'example.com'} will result in: "mycookie=myvalue; Domain=.example.com; Path=/"
Cookies.set('mycookie', 'myvalue', {domain: 'example.com'}
"mycookie=myvalue; Domain=.example.com; Path=/"
However If I want to remove it with the same attributes, the cookie is not removed:
Cookies.remove('mycookie', {domain: 'example.com'}
Prepending a period to the domain fixed it for me:
Cookies.remove('mycookie', {domain: '.example.com'}
The text was updated successfully, but these errors were encountered:
I don't think this is a bug, but expected behavior from browsers. When setting a cookie that should be accessible from both a domain and its subdomains, the domain is supposed to have a period prepended. See https://stackoverflow.com/questions/3089199/can-subdomain-example-com-set-a-cookie-that-can-be-read-by-example-com.
Sorry, something went wrong.
Sure
No branches or pull requests
When I set a cookie with domain
example.com
fromfoo.example.com
the domain of the cookie is being set to.example.com
.Cookies.set('mycookie', 'myvalue', {domain: 'example.com'}
will result in:"mycookie=myvalue; Domain=.example.com; Path=/"
However If I want to remove it with the same attributes, the cookie is not removed:
Cookies.remove('mycookie', {domain: 'example.com'}
Prepending a period to the domain fixed it for me:
Cookies.remove('mycookie', {domain: '.example.com'}
The text was updated successfully, but these errors were encountered: