const middSession = require('midd-session')
app.use(middSession())
Options have:
- secret: string. key used to encrypt the session id
- store: used to save the session info in server, default is memory store
- ttl: number|string. string will be parsed by
ms
package to milliseconds. - name: string. cookie name
- cookie: object
- path: cookie path
- maxAge: number. seconds for cookie cache
Create a memory store with options:
- interval: number. Auto clean expired session with the specified milliseconds
Get the session id
Get or set custom attributes in session
midd-session-file-store
midd-session-mysql-store
Licensed under MIT
Copyright (c) 2017 Tian Jian