trench-session
Session middleware for Trench, using Redis.
Usage
const Trench = ;const session = ;const app = ;app;app;app;
API
session([options])
Returns a middleware function to generate functions, then save them when res.end()
is called.
options
app
Type: string
A name for the application, used so you can store multiple app's sessions in the same redis database, without possibility of interference.
expire
Type: number
Amount of seconds until the session expires, since last saved.
db
Type: string
, object
Connection configuration, to be passed to redis.createClient()
.
client
Type: object
A redis client, i.e. created by redis.createClient()
.