carmine
carmine copied to clipboard
[ring middleware] Reset session expiration on every read
This change introduces a new option :extend-on-read?
to the Ring middleware. By default it is false
. When false
, the session expiration will be set when it is created ~~(and not changed afterwards)~~ and when it is written (which normally doesn't happen when using the ring-session middleware). When true
the session expiration is reset on every read, so that the session is always valid for the set number of seconds after it was last used.
Updated pull request for #259.
@svdo Thanks Stefan! Will look at merging next time I'm doing some batched work on Carmine.
Just a heads-up that this part of your understanding isn't accurate:
When false, the session expiration will be set when it is created (and not changed afterwards)
When false, the session is also renewed on any session writes (changes).
I.e. the extend-on-read?
options would be:
-
false
(default): renew session only on session writes -
true
: renew session also on session reads
Hope that makes sense!
Yes I understand, thanks for clarifying!!
@svdo Will be merged in next release, thanks Stefan! Apologies for the long delay.
No problem at all @ptaoussanis, I've been using my fork so that didn't cause any issues for me :)