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

fix: skip re-saving session when not modified since save #849

Merged
merged 1 commit into from
May 11, 2022

Conversation

jneander
Copy link
Contributor

When the saveUninitialized option is set to false, sessions will be
saved at the end of the request even when they have already been saved
earlier in the request and not subsequently modified. The result is a
double save that can potentially be wasteful with the persistence layer.
This change checks for modification of the session before saving, and
saves only if needed.

@jneander

This comment has been minimized.

@jneander

This comment has been minimized.

@dougwilson

This comment has been minimized.

@dougwilson dougwilson added the pr label Oct 18, 2021
@jneander

This comment has been minimized.

Copy link
Contributor

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the long delay :(

@dougwilson dougwilson merged commit 99d6cde into expressjs:master May 11, 2022
SamTV12345 pushed a commit to ether/express-session that referenced this pull request Jul 3, 2023
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