Clearing session does not remove cookies
See original GitHub issueSeems like I’m experiencing a similar issue to this one: https://github.com/expressjs/cookie-session/issues/100
When setting req.session = null
the cookie does not get removed.
There is actually a test that explicitly checks the cookie is still available:
https://github.com/expressjs/cookie-session/blob/master/test/test.js#L350
It seems like the cookie should get cleared when the session is. Unfortunately I cannot see a way to reliably clear the cookie in the Cookie module either.
Should it be doing something like this?
https://github.com/expressjs/cookie-session/compare/master...PaulCampbell:clear-cookies
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Does Session.Abandon delete the Cookie? - MSDN - Microsoft
The quick answer is: "No, it does not delete the sessionID cookie". ... budugu had a neat suggestion to do this: Session.Abandon(); Response.Cookies.Add(new ......
Read more >Not deleting session cookies.. Is it safe?
Session cookies in Chrome are referred to as "Local Data": Settings -> Content settings. If clicking "Allow local data to be set (Recommended)" ......
Read more >Chrome deletes cookies and sessions but it shouldn't
Chrome deletes cookies and sessions but it shouldn't - Super User. Stack Overflow for Teams – Start collaborating and sharing organizational ...
Read more >`req.session.destroy()` does not remove cookies with the latest ...
Hi, I have come across a very annoying bug recently. If you upgrade nextjs to the latest version, which is 10.0.3, and deploy...
Read more >Clear, enable, and manage cookies in Chrome - Google Support
Clear all cookies · On your computer, open Chrome Chrome . · At the top right, click More More and then Settings Settings...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Haha, no problem. I do read them all, even if I don’t have a chance to respond 👍 . I love to help out, though responses, code, or docs! I’ll get the docs improved up around how, specifically, the cookie is managed, as I think there have been a few questions around it.
This module never clears the cookie, only clears the data from the session when setting to null – the cookie will stay around to keep subsequent requests from constantly trying to reset the cookie again and ready to put more data in the session.
This module doesn’t say that setting it to null will actually clear the cookie, but to be fair, it also doesn’t describe what it does, specifically. The docs can be improved.