SessionOptions
Hierarchy
- Omit<CookieSetOptions, maxAge>
- SessionOptions
Index
Properties
optionalContextStore
optionalautoCommit
decode
enable
encode
optionalexternalKey
External key is used the cookie by default, but you can use options.externalKey to customize your own external key methods.
genid
key
cookie key (default is koa:sess)
optionalmaxAge
maxAge in ms (default is 1 days) “session” will result in a cookie that expires when session/browser is closed Warning: If a session cookie is stolen, this cookie will never expire
optionalprefix
If you want to add prefix for all external session id, you can use options.prefix, it will not work if options.genid present.
optionalrenew
Renew session when session is nearly expired, so we can always keep user logged in. (default is false)
optionalrolling
Force a session identifier cookie to be set on every response. The expiration is reset to the original maxAge, resetting the expiration countdown. default is false
Methods
optionalbeforeSave
Hook: before save session
optionalvalid
Hook: valid session value before use it
(boolean) automatically commit headers (default true).