connect-cradle is a Cradle session store backed by cradle, and is insanely fast :). Requires cradle >= 0.1.0
for the SETEX command.
This code is not working atm, more testing needed. Pull request are welcome. Do not blame me if your cat explode while trying to authenticate to your project with this session store! :3
$ npm install connect-cradle
host
Redis server hostnameport
Redis server portnodb
Database index to usepass
Password for Redis authentication- ... Remaining options passed to the redis
createClient()
method.
Due to npm 1.x changes, we now need to pass connect to the function connect-cradle
exports in order to extend connect.session.Store
:
var connect = require('connect')
, CradleStore = require('connect-cradle')(connect);
connect.createServer(
connect.cookieParser(),
// 5 minutes
connect.session({ store: new CradleStore, 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-cradle')(express);
Tj I almost feel shame to copy bit-a-bit most of your connect-redis code but I'm a really lazy programmer :P Thanks for all your work! \o/