implement setDuration
This commit is contained in:
Родитель
f0a6fd6efc
Коммит
ee2e6e4b30
|
@ -76,6 +76,12 @@ Session.prototype = {
|
|||
this.dirty = true;
|
||||
},
|
||||
|
||||
setDuration: function(newDuration) {
|
||||
this.loadFromCookie();
|
||||
this.dirty = true;
|
||||
this.duration = newDuration;
|
||||
},
|
||||
|
||||
// take the content and do the encrypt-and-sign
|
||||
// boxing builds in the concept of createdAt
|
||||
box: function() {
|
||||
|
@ -200,6 +206,8 @@ Session.prototype = {
|
|||
sessionHandler.get = function(rcvr, name) {
|
||||
if (['reset'].indexOf(name) > -1) {
|
||||
return raw_session[name].bind(raw_session);
|
||||
} else if (['setDuration'].indexOf(name) > -1) {
|
||||
return raw_session[name].bind(raw_session);
|
||||
} else {
|
||||
if (!raw_session.loaded)
|
||||
raw_session.loadFromCookie();
|
||||
|
|
|
@ -422,14 +422,12 @@ suite.addBatch({
|
|||
browser.get("/create", function(res, $) {
|
||||
browser.get("/change", function(res, $) {
|
||||
setTimeout(function () {
|
||||
browser.get("/complete", function(res, $) {
|
||||
});
|
||||
}, 800);
|
||||
browser.get("/complete", function(res, $) { });
|
||||
}, 700);
|
||||
});
|
||||
});
|
||||
},
|
||||
"session no longer has state": function(err, req) {
|
||||
console.log(req.session);
|
||||
assert.isUndefined(req.session.foo);
|
||||
}
|
||||
}
|
||||
|
@ -471,7 +469,6 @@ suite.addBatch({
|
|||
browser.get("/foo", function(res, $) {
|
||||
self.callback(null, res);
|
||||
});
|
||||
|
||||
},
|
||||
"cannot be set": function(err, res) {
|
||||
assert.equal(res.statusCode, 500);
|
||||
|
|
Загрузка…
Ссылка в новой задаче