Skip to content

Conversation

ejose19
Copy link

@ejose19 ejose19 commented May 24, 2020

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)

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 2f6926f on ejose19:master into f765595 on koajs:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants