Socket
Socket
Sign inDemoInstall

koa-generic-session

Package Overview
Dependencies
7
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.11.5 to 1.11.6

5

History.md
1.11.6 / 2017-06-12
==================
* fix: cookie options may be changed
1.11.5 / 2017-01-16

@@ -3,0 +8,0 @@ ==================

7

lib/session.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc