@lennym/redis-session

2.2.0 • Public • Published

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 string
  • host - String - hostname of your redis instance - default localhost
  • port - Number - port of your redis instance - default 6379
  • ttl - Number - expiry time of your session in seconds - default null
  • name - String - the name of the session cookie - default sid
  • path - String - the path of the session cookie - default /
  • secure - Boolean - if set to true will only transmit session cookies over https connections - default process.env.NODE_ENV === 'production'

Readme

Keywords

Package Sidebar

Install

npm i @lennym/redis-session

Weekly Downloads

4

Version

2.2.0

License

MIT

Unpacked Size

7.39 kB

Total Files

12

Last publish

Collaborators

  • lennym