connect-redis
Advanced tools
Comparing version 2.2.0 to 2.3.0
2.3.0 / 2015-04-28 | ||
================== | ||
* add; `touch` / support `resave: false` [stuartpb] | ||
* mod; package.json license [mikaturunen] | ||
2.2.0 / 2015-01-26 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -19,2 +19,9 @@ /*! | ||
function getTTL(store, sess) { | ||
var maxAge = sess.cookie.maxAge; | ||
return store.ttl || (typeof maxAge === 'number' | ||
? maxAge / 1000 | 0 | ||
: oneDay); | ||
} | ||
/** | ||
@@ -194,6 +201,3 @@ * Return the `RedisStore` extending `express`'s session Store. | ||
var maxAge = sess.cookie.maxAge; | ||
var ttl = store.ttl || (typeof maxAge === 'number' | ||
? maxAge / 1000 | 0 | ||
: oneDay); | ||
var ttl = getTTL(store, sess); | ||
@@ -221,3 +225,27 @@ debug('SETEX "%s" ttl:%s %s', sid, ttl, jsess); | ||
/** | ||
* Refresh the time-to-live for the session with the given `sid`. | ||
* | ||
* @param {String} sid | ||
* @param {Session} sess | ||
* @param {Function} fn | ||
* @api public | ||
*/ | ||
RedisStore.prototype.touch = function (sid, sess, fn) { | ||
var store = this; | ||
var psid = store.prefix + sid; | ||
if (!fn) fn = noop; | ||
var ttl = getTTL(store, sess); | ||
debug('EXPIRE "%s" ttl:%s', sid, ttl); | ||
store.client.expire(psid, ttl, function (er) { | ||
if (er) return fn(er); | ||
debug('EXPIRE complete'); | ||
fn.apply(this, arguments); | ||
}); | ||
}; | ||
return RedisStore; | ||
}; |
{ | ||
"name": "connect-redis", | ||
"description": "Redis session store for Connect", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
"contributors": [ | ||
"Marc Harter <wavded@gmail.com>" | ||
], | ||
"license": "MIT", | ||
"main": "./index.js", | ||
@@ -7,0 +11,0 @@ "repository": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
16546
0
327
1