koa-generic-session
Advanced tools
Comparing version 1.11.5 to 1.11.6
1.11.6 / 2017-06-12 | ||
================== | ||
* fix: cookie options may be changed | ||
1.11.5 / 2017-01-16 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -53,3 +53,3 @@ /**! | ||
* - [`genSid`] you can use your own generator for sid | ||
* - [`errorHanlder`] handler for session store get or set error | ||
* - [`errorHandler`] handler for session store get or set error | ||
* - [`valid`] valid(ctx, session), valid session value before use it | ||
@@ -120,5 +120,2 @@ * - [`beforeSave`] beforeSave(ctx, session), hook before save session | ||
// save empty session hash for compare | ||
const EMPTY_SESSION_HASH = hash(generateSession()); | ||
return options.defer ? deferSession : session; | ||
@@ -261,3 +258,3 @@ | ||
// if new session and not modified, just ignore | ||
if (!options.allowEmpty && isNew && newHash === EMPTY_SESSION_HASH) { | ||
if (!options.allowEmpty && isNew && newHash === hash(generateSession())) { | ||
return debug('new session and do not modified'); | ||
@@ -264,0 +261,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/generic-session", | ||
"version": "1.11.5", | ||
"version": "1.11.6", | ||
"files": [ | ||
@@ -8,0 +8,0 @@ "lib", |
@@ -27,4 +27,6 @@ generic-session | ||
Generic session middleware for koa, easy use with custom stores such as [redis](https://github.com/koajs/koa-redis) or [mongo](https://github.com/freakycue/koa-generic-session-mongo), supports defer session getter. different from [koa-session](https://github.com/koajs/session)(it is cookie session). | ||
__Notice: [koa-session](https://github.com/koajs/session) support external store now, please migrate to koa-session.__ | ||
Generic session middleware for koa, easy use with custom stores such as [redis](https://github.com/koajs/koa-redis) or [mongo](https://github.com/freakycue/koa-generic-session-mongo), supports defer session getter. | ||
This middleware will only set a cookie when a session is manually set. Each time the session is modified (and only when the session is modified), it will reset the cookie and session. | ||
@@ -154,2 +156,3 @@ | ||
- [koa-generic-session-sequelize](https://github.com/natesilva/koa-generic-session-sequelize) to store your session data with the [Sequelize](http://docs.sequelizejs.com/) ORM. | ||
- [koa-generic-session-knex](https://github.com/EarthlingInteractive/koa-generic-session-knex) to store your session data with the [Knex](http://knexjs.org/) query builder. | ||
@@ -156,0 +159,0 @@ ## Licences |
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
30393
167
487