Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ parallel requests to your server and changes made to the session in one
request may get overwritten when the other request ends, even if it made no
changes (this behavior also depends on what store you're using).

The default value is `true`, but using the default has been deprecated,
as the default will change in the future. Please research into this setting
The default value is `false`. Please research into this setting
and choose what is appropriate to your use-case. Typically, you'll want
`false`.

Expand Down
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ function session(options) {
}

if (resaveSession === undefined) {
deprecate('undefined resave option; provide resave option');
resaveSession = true;
resaveSession = false;
}

if (saveUninitializedSession === undefined) {
Expand Down
17 changes: 9 additions & 8 deletions test/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ describe('session()', function(){
});

describe('resave option', function(){
it('should default to true', function(done){
it('should default to false', function(done){
var store = new session.MemoryStore()
var server = createServer({ store: store }, function (req, res) {
req.session.user = 'bob'
Expand All @@ -946,14 +946,15 @@ describe('session()', function(){
request(server)
.get('/')
.expect(shouldSetSessionInStore(store))
.expect(200, function(err, res){
if (err) return done(err);
.expect(200, function (err, res) {
if (err) return done(err)

request(server)
.get('/')
.set('Cookie', cookie(res))
.expect(shouldSetSessionInStore(store))
.expect(200, done);
});
.get('/')
.set('Cookie', cookie(res))
.expect(shouldNotSetSessionInStore(store))
.expect(200, done)
})
});

describe('when true', function () {
Expand Down