Session never destroyed
See original GitHub issueHi,
I’m using generic-session
with koa-redis
on a side project and can’t figure out how to destroy the session. I mean, I have a /logout
route that is suppose to destroy the current session with the following code:
router.get('/logout', function *() {
console.log('logout');
this.session = null;
this.status = 200;
});
As mentioned in the README.md, this.session = null
should destroy the session but in fact nothing happened. I put some console.log
in the destroy
method of koa-redis
and I noticed this function was never called.
FYI, modules versions are:
koa
: 1.1.2koa-generic-session
: 1.10.0koa-redis
: 1.0.1 And session are created bykoa-passport
(1.x.x)
I try to make test
in koa-redis
and koa-generic-session
and everything works as expected, 100% passed.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Session data not destroyed after returning to previous page in ...
I intended to send new session data each time, deleting the previous. session_destroy(); $_SESSION['showvals'] = array();. None of this worked.
Read more >How to destroy a session when the listen server host closes ...
Basically, I'm just looking for a good place to call my destroy session function for when you're disconnected by the server. I'm using...
Read more >session_destroy - Manual - PHP
session_destroy() destroys all of the data associated with the current session. It does not unset any of the global variables associated with the...
Read more >Do you expect the entire session to be destroyed when ...
I'm currently thinking about what happens when I log out of a website, and how that applies to Community Auth. Right now, when...
Read more >Control the Session with Spring Security - Baeldung
For a more stateless application, the “never” option will ensure that Spring Security itself won't create any session.
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
added some test cases for rolling session, anybody can reproduce the issue and create a test case?
https://github.com/koajs/generic-session/commit/0b1d52eb32aa0ace4c997277542decae4b07c2ec
The bug as raised by @miserylee is still there. How can we mitigate this issue if we need to use rolling:true for every request while making sure the session was destroyed if we call it to destroy?