Closed ejose19 closed 2 years ago
If you can PR to update the README too @ejose19? Maybe add this example too?
Sure
As soon as README updated I will version release! Thank you for this excellent PR!
v2.3.0 released to npm, thank you again! 🙏 🎉
https://github.com/koajs/generic-session/releases/tag/v2.3.0
@niftylettuce thanks to you as well for your prompt review!
Currently, it's very common for websites to offer a "dynamic" session age ("remember for X/Y days", or disabling "remember" which wipes the cookie after browser is closed), however with the current implementation it's not possible to control TTL per request (for example, if cookie will have a
maxAge !== null
, use it, else use a default value). After this PR, consumers accomplish this result as this:it would allow browser-session cookies to be removed after 1 day from the store and not live indefinitely like they do now.