Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate cookie maxAge option from external store ttl #199

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

None yet

2 participants