Socket
Socket
Sign inDemoInstall

koa-generic-session

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-generic-session - npm Package Compare versions

Comparing version 1.1.0 to 1.1.2

10

History.md
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 @@ ==================

7

lib/session.js

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc