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

session regeneration #34

Closed
zubairhamid opened this issue Feb 23, 2015 · 4 comments
Closed

session regeneration #34

zubairhamid opened this issue Feb 23, 2015 · 4 comments

Comments

@zubairhamid
Copy link

some method definition is required for reset/regeneration of session. if any please inform.

@palmtale
Copy link

palmtale commented May 4, 2017

Why not fix this issue? Could someone give a comment?
cause I found it's easy to do.

palmtale added a commit to so-glad/koa-session that referenced this issue May 5, 2017
Signed-off-by: Cartoon Zhang <cartoon.zhang@zeofast.com>
@urugator
Copy link

I also wonder about this. How can I re-create the session? I want to logout current user just before logging in the new one:

// if some user is already logged in destroy his session
if (!ctx.session.isNew) {
   ctx.session = null;            
}    
// login
ctx.session.userId = userId;

Can't getter create new session automatically if necessary?

I tried to do it like this:

ctx.session = null;
await KoaSession(ctx.app).call(this, ctx, next);

But it will throw TypeError: Cannot redefine property: sessionOptions

@ethanpollitt
Copy link

Not sure if this has been added, but I can't find a reference in the docs. I also have the same use case of destroying/recreating a session in a single call.

lehni added a commit to ditojs/koa-session that referenced this issue Dec 4, 2022
lehni added a commit to ditojs/koa-session that referenced this issue Dec 4, 2022
lehni added a commit to ditojs/koa-session that referenced this issue Dec 5, 2022
lehni added a commit to ditojs/koa-session that referenced this issue Dec 5, 2022
@lehni
Copy link
Contributor

lehni commented Feb 4, 2023

@fengmk2 with #221 merged, this can be closed now. 🎉

@fengmk2 fengmk2 closed this as completed Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants