Socket
Socket
Sign inDemoInstall

connect-redis

Package Overview
Dependencies
Maintainers
3
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-redis - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

6

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

36

lib/connect-redis.js

@@ -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": {

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