masylum/connect-mongodb — pull request #61 by fatjonny (2012-08-15 20:48:24+00:00)
Title: Adds safe:true to set function.

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.