1.0.1 • Published 12 years ago
connect-redis-secure v1.0.1
Connect Redis Secure
connect-redis-secure (a fork of connect-redis) is a Redis session store backed by node_redis, and is insanely fast :). Requires redis >= 2.0.0 for the SETEX command.
The only difference to the original is that the sessions are encrypted before they are written to the database.
connect-redis >= 1.0.0 support only connect >= 1.0.0.
Installation
$ npm install connect-redisOptions
clientAn existing redis client object you normally get fromredis.createClient()hostRedis server hostnameportRedis server portnottlRedis session TTL in secondsdbDatabase index to usepassPassword for Redis authenticationprefixKey prefix defaulting to "sess:"- ... Remaining options passed to the redis
createClient()method.
Usage
Due to npm 1.x changes, we now need to pass connect to the function connect-redis exports in order to extend connect.session.Store:
var connect = require('connect')
, RedisStore = require('connect-redis')(connect);
connect()
.use(connect.session({ store: new RedisStore(options), secret: 'keyboard cat' })) This means express users may do the following, since express.session.Store points to the connect.session.Store function:
var RedisStore = require('connect-redis')(express);License
MIT