koa-generic-session
Advanced tools
Comparing version 1.1.0 to 1.1.2
1.1.2 / 2014-07-07 | ||
================== | ||
* delete cookie.maxAge | ||
1.1.1 / 2014-07-07 | ||
================== | ||
* fix maxage compat | ||
1.1.0 / 2014-07-07 | ||
@@ -3,0 +13,0 @@ ================== |
@@ -38,3 +38,3 @@ /**! | ||
signed: true, | ||
maxage: 24 * 60 * 60 * 1000 //one day in ms | ||
maxAge: 24 * 60 * 60 * 1000 //one day in ms | ||
}; | ||
@@ -294,5 +294,8 @@ | ||
if (opts) { | ||
opts.maxage = opts.maxage || opts.maxAge; | ||
opts.maxage = opts.maxage === undefined | ||
? opts.maxAge | ||
: opts.maxage; | ||
delete opts.maxAge; | ||
} | ||
} | ||
@@ -59,6 +59,4 @@ /**! | ||
var ttl = this.options.ttl; | ||
//compat connect-redis type `maxAge` | ||
var maxage = sess.cookie && (sess.cookie.maxage || sess.cookie.maxAge); | ||
if (!ttl) { | ||
var maxage = sess.cookie && sess.cookie.maxage; | ||
if (typeof maxage === 'number') { | ||
@@ -65,0 +63,0 @@ ttl = maxage; |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/generic-session", | ||
"version": "1.1.0", | ||
"version": "1.1.2", | ||
"keywords": ["koa", "middleware", "session"], | ||
@@ -8,0 +8,0 @@ "author": "dead_horse <dead_horse@qq.com>", |
@@ -85,5 +85,5 @@ generic-session [![Build Status](https://secure.travis-ci.org/koajs/generic-session.svg)](http://travis-ci.org/koajs/generic-session) | ||
if you set`cookie.maxAge` to `null`, meaning no "expires" parameter is set so the cookie becomes a browser-session cookie. When the user closes the browser the cookie (and session) will be removed. | ||
if you set`cookie.maxage` to `null`, meaning no "expires" parameter is set so the cookie becomes a browser-session cookie. When the user closes the browser the cookie (and session) will be removed. | ||
Notice that `ttl` is different from `cookie.maxAge`, `ttl` set the expire time of sessionStore. So if you set `cookie.maxage = null`, and `ttl=ms('1d')`, the session will expired after one day, but the cookie will destory when the user cloese the browser. | ||
Notice that `ttl` is different from `cookie.maxage`, `ttl` set the expire time of sessionStore. So if you set `cookie.maxage = null`, and `ttl=ms('1d')`, the session will expired after one day, but the cookie will destory when the user cloese the browser. | ||
And mostly you can just ignore `options.ttl`, `koa-generic-session` will parse `cookie.maxage` as the tll. | ||
@@ -90,0 +90,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40257
1061