connect-redis
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -64,5 +64,8 @@ /*! | ||
// Since we need to update the expires value on the cookie, | ||
// we update the whole session object. | ||
this.set(sid, sess, cb) | ||
let key = this.prefix + sid | ||
this.client.expire(key, this._getTTL(sess), (err, ret) => { | ||
if (err) return cb(err) | ||
if (ret !== 1) return cb(null, 'EXPIRED') | ||
cb(null, 'OK') | ||
}) | ||
} | ||
@@ -69,0 +72,0 @@ |
{ | ||
"name": "connect-redis", | ||
"description": "Redis session store for Connect", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -76,8 +76,9 @@ const test = require('blue-tape') | ||
ttl = 90 | ||
expires = new Date(Date.now() + ttl * 1000).toISOString() | ||
res = await p(store, 'touch')('456', { cookie: { expires } }) | ||
let newExpires = new Date(Date.now() + ttl * 1000).toISOString() | ||
// note: cookie.expires will not be updated on redis (see https://github.com/tj/connect-redis/pull/285) | ||
res = await p(store, 'touch')('456', { cookie: { expires: newExpires } }) | ||
t.equal(res, 'OK', 'set cookie expires touch') | ||
res = await p(store.client, 'ttl')('sess:456') | ||
t.ok(res >= 60, 'check expires ttl touch') | ||
t.ok(res > 60, 'check expires ttl touch') | ||
@@ -84,0 +85,0 @@ res = await p(store, 'length')() |
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
16671
268