session icon indicating copy to clipboard operation
session copied to clipboard

Separate cookie maxAge option from external store ttl

Open ejose19 opened this issue 5 years ago • 1 comments

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)

ejose19 avatar May 24 '20 01:05 ejose19

Coverage Status

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

coveralls avatar May 24 '20 01:05 coveralls