Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ianmcqueen's avatar

Laravel Is Not Clearing Redis Session Cache

Hi there,

I have a server that uses database 0 for generic Redis stuff and database 1 for all of our session data. For database 1 where our session data is stored, the Redis dbsize has ballooned to over >3GB and has 2.8 million keys. I cleared this database only a few months ago.

I know that a simple select 1; flushdb; will do the trick but my question is... is Laravel cleaning or expiring these session keys automatically or does it Cache::forever them? My session lifetime in config/session.php is set to 43200 or 30 days but I'm not sure if this value is used for Redis session caching.

Please advise.

0 likes
0 replies

Please or to participate in this conversation.