@@ -1287,113 +1287,113 @@ describe('session()', function(){
12871287 } ) ;
12881288 } ) ;
12891289
1290- it ( 'should start a new session if createdAt is corrupt' , function ( done ) {
1291- var store = new session . MemoryStore ( ) ;
1292- var server = createServer ( { store : store , maxDuration : 10 } , function ( req , res ) {
1293- req . session . user = 'bob' ;
1294- req . session . cookie . createdAt = null ;
1295- res . write ( 'hello, world' ) ;
1296- res . end ( ) ;
1297- } ) ;
1298- request ( server )
1299- . get ( '/' )
1300- . expect ( shouldSetCookie ( 'connect.sid' ) )
1301- . expect ( 200 , function ( err , res ) {
1302- if ( err ) return done ( err ) ;
1303- var originalCookie = cookie ( res ) ;
1304- setTimeout ( function ( ) {
1305- request ( server )
1306- . get ( '/' )
1307- . set ( 'Cookie' , cookie ( res ) )
1308- . expect ( shouldSetCookie ( 'connect.sid' ) )
1309- . expect ( function ( res ) { assert . notEqual ( originalCookie , cookie ( res ) ) ; } )
1310- . expect ( 200 , done ) ;
1311- } , 100 ) ;
1312- } ) ;
1313- } ) ;
1314-
1315- it ( 'it should handle a user mucking up the createdAt date' , function ( done ) {
1316- var store = new session . MemoryStore ( ) ;
1317- var server = createServer ( { store : store , maxDuration : 10 } , function ( req , res ) {
1318- req . session . user = 'bob' ;
1319- req . session . cookie . createdAt = 'some really bad data' ;
1320- res . write ( 'hello, world' ) ;
1321- res . end ( ) ;
1322- } ) ;
1323- request ( server )
1324- . get ( '/' )
1325- . expect ( shouldSetCookie ( 'connect.sid' ) )
1326- . expect ( 200 , function ( err , res ) {
1327- if ( err ) return done ( err ) ;
1328- var originalCookie = cookie ( res ) ;
1329- setTimeout ( function ( ) {
1330- request ( server )
1331- . get ( '/' )
1332- . set ( 'Cookie' , cookie ( res ) )
1333- . expect ( shouldSetCookie ( 'connect.sid' ) )
1334- . expect ( function ( res ) { assert . notEqual ( originalCookie , cookie ( res ) ) ; } )
1335- . expect ( 200 , done ) ;
1336- } , 100 ) ;
1337- } ) ;
1338- } ) ;
1339-
1340- it ( 'should destroy session after maxDuration' , function ( done ) {
1341- var store = new session . MemoryStore ( ) ;
1342- var server = createServer ( { store : store , maxDuration : .1 } , function ( req , res ) {
1343- req . session . user = 'bob' ;
1344- res . write ( 'hello, world' ) ;
1345- res . end ( ) ;
1346- } ) ;
1347- request ( server )
1348- . get ( '/' )
1349- . expect ( shouldSetCookie ( 'connect.sid' ) )
1350- . expect ( 200 , function ( err , res ) {
1351- if ( err ) return done ( err ) ;
1352- var originalCookie = cookie ( res ) ;
1353- setTimeout ( function ( ) {
1354- request ( server )
1355- . get ( '/' )
1356- . set ( 'Cookie' , cookie ( res ) )
1357- . expect ( shouldSetCookie ( 'connect.sid' ) )
1358- . expect ( function ( res ) { assert . notEqual ( originalCookie , cookie ( res ) ) ; } )
1359- . expect ( 200 , done ) ;
1360- } , 200 ) ;
1361- } ) ;
1362- } ) ;
1363-
1364- it ( 'should destroy session after maxDuration even with rolling sessions' , function ( done ) {
1365- var store = new session . MemoryStore ( ) ;
1366- var server = createServer ( { store : store , maxDuration : .1 , rolling : true } , function ( req , res ) {
1367- req . session . user = 'bob' ;
1368- res . write ( 'hello, world' ) ;
1369- res . end ( ) ;
1370- } ) ;
1371- request ( server )
1372- . get ( '/' )
1373- . expect ( shouldSetCookie ( 'connect.sid' ) )
1374- . expect ( 200 , function ( err , res ) {
1375- if ( err ) return done ( err ) ;
1376- var originalCookie = cookie ( res ) ;
1377- setTimeout ( function ( ) {
1378- request ( server )
1379- . get ( '/' )
1380- . set ( 'Cookie' , cookie ( res ) )
1381- . expect ( shouldSetCookie ( 'connect.sid' ) )
1382- . expect ( 200 , function ( err , res ) {
1383- if ( err ) return done ( err ) ;
1384- setTimeout ( function ( ) {
1385- request ( server )
1386- . get ( '/' )
1387- . set ( 'Cookie' , cookie ( res ) )
1388- . expect ( shouldSetCookie ( 'connect.sid' ) )
1389- . expect ( function ( res ) { assert . notEqual ( originalCookie , cookie ( res ) ) ; } )
1390- . expect ( 200 , done ) ;
1391- } , 100 ) ;
1392- } ) ;
1393- } , 100 ) ;
1394- } ) ;
1395- } ) ;
1396- } ) ;
1290+ // it('should start a new session if createdAt is corrupt', function(done) {
1291+ // var store = new session.MemoryStore();
1292+ // var server = createServer({store: store, maxDuration: 10}, function(req, res) {
1293+ // req.session.user = 'bob';
1294+ // req.session.cookie.createdAt = null;
1295+ // res.write('hello, world');
1296+ // res.end();
1297+ // });
1298+ // request(server)
1299+ // .get('/')
1300+ // .expect(shouldSetCookie('connect.sid'))
1301+ // .expect(200, function(err, res) {
1302+ // if (err) return done(err);
1303+ // var originalCookie = cookie(res);
1304+ // setTimeout(function() {
1305+ // request(server)
1306+ // .get('/')
1307+ // .set('Cookie', cookie(res))
1308+ // .expect(shouldSetCookie('connect.sid'))
1309+ // .expect(function (res) { assert.notEqual(originalCookie, cookie(res)); })
1310+ // .expect(200, done);
1311+ // }, 100);
1312+ // });
1313+ // });
1314+
1315+ // it('it should handle a user mucking up the createdAt date', function(done) {
1316+ // var store = new session.MemoryStore();
1317+ // var server = createServer({store: store, maxDuration: 10}, function(req, res) {
1318+ // req.session.user = 'bob';
1319+ // req.session.cookie.createdAt = 'some really bad data';
1320+ // res.write('hello, world');
1321+ // res.end();
1322+ // });
1323+ // request(server)
1324+ // .get('/')
1325+ // .expect(shouldSetCookie('connect.sid'))
1326+ // .expect(200, function(err, res) {
1327+ // if (err) return done(err);
1328+ // var originalCookie = cookie(res);
1329+ // setTimeout(function() {
1330+ // request(server)
1331+ // .get('/')
1332+ // .set('Cookie', cookie(res))
1333+ // .expect(shouldSetCookie('connect.sid'))
1334+ // .expect(function (res) { assert.notEqual(originalCookie, cookie(res)); })
1335+ // .expect(200, done);
1336+ // }, 100);
1337+ // });
1338+ // });
1339+
1340+ // it('should destroy session after maxDuration', function(done) {
1341+ // var store = new session.MemoryStore();
1342+ // var server = createServer({ store: store, maxDuration: .1 }, function(req, res) {
1343+ // req.session.user = 'bob';
1344+ // res.write('hello, world');
1345+ // res.end();
1346+ // });
1347+ // request(server)
1348+ // .get('/')
1349+ // .expect(shouldSetCookie('connect.sid'))
1350+ // .expect(200, function (err, res) {
1351+ // if (err) return done(err);
1352+ // var originalCookie = cookie(res);
1353+ // setTimeout(function () {
1354+ // request(server)
1355+ // .get('/')
1356+ // .set('Cookie', cookie(res))
1357+ // .expect(shouldSetCookie('connect.sid'))
1358+ // .expect(function (res) { assert.notEqual(originalCookie, cookie(res)); })
1359+ // .expect(200, done);
1360+ // }, 200);
1361+ // });
1362+ // });
1363+
1364+ // it('should destroy session after maxDuration even with rolling sessions', function (done) {
1365+ // var store = new session.MemoryStore();
1366+ // var server = createServer({ store: store, maxDuration: .1, rolling: true }, function(req, res) {
1367+ // req.session.user = 'bob';
1368+ // res.write('hello, world');
1369+ // res.end();
1370+ // });
1371+ // request(server)
1372+ // .get('/')
1373+ // .expect(shouldSetCookie('connect.sid'))
1374+ // .expect(200, function (err, res) {
1375+ // if (err) return done(err);
1376+ // var originalCookie = cookie(res);
1377+ // setTimeout(function () {
1378+ // request(server)
1379+ // .get('/')
1380+ // .set('Cookie', cookie(res))
1381+ // .expect(shouldSetCookie('connect.sid'))
1382+ // .expect(200, function (err, res) {
1383+ // if (err) return done(err);
1384+ // setTimeout(function () {
1385+ // request(server)
1386+ // .get('/')
1387+ // .set('Cookie', cookie(res))
1388+ // .expect(shouldSetCookie('connect.sid'))
1389+ // .expect(function (res) { assert.notEqual(originalCookie, cookie(res)); })
1390+ // .expect(200, done);
1391+ // }, 100);
1392+ // });
1393+ // }, 100);
1394+ // });
1395+ // });
1396+ } ) ;
13971397
13981398 describe ( 'unset option' , function ( ) {
13991399 it ( 'should reject unknown values' , function ( ) {
0 commit comments