Skip to content

Conversation

fatjonny
Copy link

Makes the functionality expected from calling req.session.save(fn)
actually happen by waiting for the response from the database
before calling the callback function.

For instance, if I want to set a variable on the session that has to
exist before redirecting I would want to do:

req.session.importantVariable = localImportantVariable;
req.session.save( function( err ) { res.redirect( '/superSecretUrl' ); } );

Without safe:true there is a chance that req.session.importantVariable
is not set when we get to /superSecretUrl and the behavior can be
inconsistent.

Makes the functionality expected from calling req.session.save(fn)
actually happen by waiting for the response from the database
before calling the callback function.
@fatjonny
Copy link
Author

I see that this is actually done in 98dfc41 from #60 if that gets accepted.

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

Successfully merging this pull request may close these issues.

1 participant