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 remove cookie with domain #30

Closed
xzilja opened this issue Jul 5, 2016 · 3 comments
Closed

Unable to remove cookie with domain #30

xzilja opened this issue Jul 5, 2016 · 3 comments

Comments

@xzilja
Copy link

xzilja commented Jul 5, 2016

I set my cookies in 2 ways, note cookie comes from var cookie = require('react-cookie')

Cookie for localhost:

    cookie.save('sessionToken', '123')

Cookie for production

    cookie.save('sessionToken', '123, { domain: 'my.domain.io', secure: true })

These set cookies correctly, the only strange observation I can see is that in production case, cookies domain is set to .my.domain.io (has additional dot in front)

I then try to remove the cookie like so: cookie.remove('sessionToken') which works as expected on localhost, but doesn't get rid of the cookie on production.

@xzilja xzilja changed the title Unable to remove cookie with domain and secure Unable to remove cookie with domain Jul 5, 2016
@xzilja xzilja closed this as completed Jul 5, 2016
@amalv
Copy link

amalv commented Mar 10, 2017

I'm having a similar problem.

How did you fix this?

@delveintechnolabs
Copy link

Having somewhat same problem.
When login i do Cookie.save('my-cookie-name', {name: 'abx', email: 'abc@xyz.com'});
When logout i do Cookie.remove('my-cookie-name')
(My app runs on localhost)
But doesnt work.

Help Please...!!!!

@abhilash-linkites
Copy link

I am also facing the same issue. Does anyone find any solution?

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

4 participants