roidrage / redis-session-store

A simple session store for Rails based on Redis.
http://github.com/roidrage/redis-session-store
MIT License
366 stars 147 forks source link

How/when to clear old sessions? #70

Closed noctivityinc closed 8 years ago

noctivityinc commented 8 years ago

How would we go about clearing out old session data from Redis so the db doesn't grow too large? Also, when would you recommend we do that?

meatballhat commented 8 years ago

@noctivityinc Hey :smile_cat:! This is the intent of the expire_after option, as it uses SETEX instead of plain SET. The existence of the behavior with SET is there for setups where Redis is managed out of band, or for applications like internal admin tools where infinite sessions for small user bases might be desired.