Skip to content

Conversation

sgpinkus
Copy link

Why? The scope calling regenerate (or reload) does not necessarily want or need to know what a req is. Passing the new session object as a callback parameter allows the callback to regenerate or resave then make changes without knowing about req. Example:

  session.regenerate((err, newSession) => {
    if(err) return next(err);
    session.justRegenerated = true;  // Just an example.
  });

I specifically wanted this to Session.regenerate but added to Session.reload too for consistency. Might also want it in Session.save callback but that seems to require change in the behaviour of plugins so I gave it a pass.

@ejcheng ejcheng added the pr label Jul 31, 2022
@sgpinkus
Copy link
Author

@import-brain, @dougwilson Any chance merge?

@dougwilson dougwilson force-pushed the master branch 2 times, most recently from 9d2e29b to 408229e Compare January 28, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants