connect-redsess ![Build status](https://travis-ci.org/uber/connect-redsess.png?branch=master)
Redis session middleware for Connect/Express
using Redsess.
Installation
npm install connect-redsess
Usage
var connect = require('connect');
var connectRedsess = require('connect-redsess');
var app = connect();
app.use(connectRedsess());
By default, the middleware will set the Redsess object onto req.session
.
req.session.get('auth', function (err, auth) {
if (!auth) {
} else {
}
});
Constructor Options
connectRedsess(options);
Pass an object to connect-redsess on instantiation with any of
Redsess' options
as well as the following addition(s):
- requestKey
String
The key at which to attach the Redsess object onto the
req
object. Defaults to session
.
req.redsessOptions
You may also attach an object onto the req
at req.redsessOptions
with the same options as above. This is useful for any options that are set
per-request (cookies
, token
, etc.). These will override any previously set.
req.redsessOptions = {
cookies: req.cookies
};