Cache TTL option
yani opened this issue · comments
Currently, there is no TTL for sessions stored in the cache.
My custom Redis cache is filling up because sessions are not removed after a set amount of time.
These are controlled by the gcMaxLifetime config option. See
Line 94 in 6b59688
It doesn't seem to be used.
It's used, check your config maybe? Note that RedisHandler extends ScrapbookHandler.
Oh I see. I'm using Symfony's RedisAdapter as my PSR6 and PSR16 Cache. It has a default lifetime of infinite. I changed it and the Session TTL also changed.
Wouldn't it be better to set the TTL when creating the Session in the cache?
PSR-16 CacheInterface:
public function set($key, $value, $ttl = null);