@lennym/redis-session
v2.2.0
Published
A redis-backed session store for express
Downloads
583
Readme
redis-session
A redis-backed session store for express
redis-session
simplifies the setting up of a redis backed session store for express.
Usage
const app = express();
const session = require('@lennym/redis-session');
app.use(session({ secret: 'a better secret than this' }));
Options
secret
- String - Required - used to sign cookies and encrypt data in redis. Should be a high-entropy stringhost
- String - hostname of your redis instance - defaultlocalhost
port
- Number - port of your redis instance - default6379
ttl
- Number - expiry time of your session in seconds - defaultnull
name
- String - the name of the session cookie - defaultsid
path
- String - the path of the session cookie - default/
secure
- Boolean - if set to true will only transmit session cookies over https connections - defaultprocess.env.NODE_ENV === 'production'