-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lifetime mismatch between session key and session value when expire_after: nil
is set.
#70
Comments
@hogelog The behavior of I can see that on line 14, we're calling The closest I'd like to get in this gem is option 3, but if you set |
Yes. I had a little accident on my application with the redis-rack gem this |
@hogelog yeah I can imagine something like setting that expire after to an env var that doesn't exist would trigger this behavior. Looking into it now to see if this would be safe. |
I was developing a Rails app that switches the session store to redis and accidentally set
expire_after: nil
. I found a strange behavior with that setting and I'd like to report it.expire_after: nil
setting makes lifetime mismatchWith
expire_after: nil
setting, client's session key is sometime expired, but session value is not expired.So the redis will accumulate more and more non-volatile keys.
Of course, I am aware that using the redis session store with
expire_after: nil
is not a good idea. However, the current behavior is confused for me.Reproduction
I checked with the following code.
Procedure
ruby app.rb
What to do
How the
expire_after: nil
setting should work.1. Match the session key deadline
Storing session with
expire_after: nil
in the session cookie setting is rack's default behavior.This method seems the least confusing.
2. Match the session value expiration date
There may be some confusion because the default session behavior of rack.
However, it may be consistent within redis-rack.
3. Nothing to do
As I described earlier, I think it is a confusing and not happy behavior.
The text was updated successfully, but these errors were encountered: