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

ability to clear cookie #62

Open
goldensunliu opened this issue Aug 12, 2015 · 6 comments
Open

ability to clear cookie #62

goldensunliu opened this issue Aug 12, 2015 · 6 comments
Assignees

Comments

@goldensunliu
Copy link

expose a method in the API to clear/expire a cookie

like how they do here
http://expressjs.com/api.html#res.clearCookie

@dougwilson dougwilson self-assigned this Aug 12, 2015
@yekver
Copy link

yekver commented Sep 14, 2015

+1 really needed feature

@dougwilson
Copy link
Contributor

Please feel free to make a PR if you are looking for the feature soon.

@rjmunro
Copy link

rjmunro commented Jan 18, 2016

Would setting maxAge to -1 not do it?

@dougwilson
Copy link
Contributor

Even setting maxAge to 0 will work; I think the ask here is to have an API that is clear that the operation is to clear the cookie, instead of needed everyone to understand that setting a cookie that will immediately expire will do that.

@rjmunro
Copy link

rjmunro commented Jan 20, 2016

@dougwilson Looking at the code, I think setting maxAge to 0 won't work as 0 is falsey - setting it to 0 means that it will be ignored. The code here does:

if (this.maxAge) this.expires = new Date(Date.now() + this.maxAge);

@shuperry
Copy link

Waitting to add destory function to cookie.

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

5 participants