-
Notifications
You must be signed in to change notification settings - Fork 113
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
Delete cookie on session destruction #143
base: master
Are you sure you want to change the base?
Conversation
Right now when the session is destroyed, the session cookie is made empty, not removed. That's an incorrect behavior, the cookie should be deleted as well. For that, we need to set the expiration date to the past, not just an empty value.
looks like browser will delete the cookie when received empty string as a cookie value ( works with chrome and safari) |
For me it affected autotests that failed when I switched from another session module. |
@@ -272,7 +272,7 @@ class ContextSession { | |||
const externalKey = this.externalKey; | |||
|
|||
if (externalKey) await this.store.destroy(externalKey); | |||
ctx.cookies.set(key, '', opts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should keep other options so we will delete ${key}.sig
also.
@dead-horse Any updates on when this fix will be merged? |
@ejose19 @dead-horse I've created a pull request with code to expire the .sig and session cookies #180 |
Right now when the session is destroyed, the session cookie is made empty, not removed.
That's an incorrect behavior, the cookie should be deleted as well. For that, we need to set the expiration date to the past, not just an empty value.