-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
destroySession
doesn't delete cookie if max-age is set
#5150
Comments
This issue has been automatically marked stale because we haven't received a response from the original author in a while 🙈. This automation helps keep the issue tracker clean from issues that are not actionable. Please reach out if you have more information for us or you think this issue shouldn't be closed! 🙂 If you don't do so within 7 days, this issue will be automatically closed. |
Ulgh. |
Having this issue as well |
This is fixed by #7252 and will be available in Remix v2 |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
What version of Remix are you using?
v1.11.0
Steps to Reproduce
maxAge
setExpected Behavior
I expected the cookie to be deleted.
Actual Behavior
Instead, I get a
set-cookie
response header that looks like__Host-session=; Max-Age=2592000; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly; Secure; SameSite=Lax
Remix blanks out the session, which is great, and causes logouts to work as expected.
Remix also sets the
Expires
set to the epoch, which is a spec-compliant way of deleting the cookie:However, the spec also states:
My interpretation is that if
Max-Age
is set, setting theExpires
to the epoch doesn't change the cookie's expiration. This is reflected in Chrome, where the above response header does not result in the cookie being deleted.May I suggest implementing this code as
The text was updated successfully, but these errors were encountered: