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

Response.clearCookie returns Error: TypeError: option expires is invalid #11

Closed
BinaryVixen899 opened this issue Aug 30, 2022 · 0 comments · Fixed by #12
Closed

Response.clearCookie returns Error: TypeError: option expires is invalid #11

BinaryVixen899 opened this issue Aug 30, 2022 · 0 comments · Fixed by #12
Assignees
Labels
bug Something isn't working

Comments

@BinaryVixen899
Copy link
Member

Version

1.0.0-alpha.9

What happened
https://fiddle.fastly.dev/fiddle/c053c616
Doing res.clearCookie in Expressly results in Error: TypeError: option expires is invalid instead of the cookie being cleared.

A workaround is to change this line to
this.cookie(key, "", { ...options, expires: new Date("Thu, 01 Jan 1970 00:00:00 GMT" )});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants