session
session copied to clipboard
Separate cookie maxAge option from external store ttl
This PR allows to individually control cookie maxAge and external store TTL, for the cases where an unified control is not desired (like using with koa-redis).
Usage:
- maxAge remains the same
- ttl default is maxAge, unless maxAge is set to 'session' and ttl defaults to ONE_DAY allowed values for ttl are: 'permanent' (passes undefined ttl to external store) or any integer value
Previously using maxAge = 'session' with koa-redis would give an out of range error (since koa-redis is trying to insert word 'session' under ttl, with this implementation it will pass an integer value to ttl or if set as 'permanent', undefined and koa-redis will store without any ttl)