-
Notifications
You must be signed in to change notification settings - Fork 70
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
SessionHandler - setEX error on session.cookie_lifetime = 0 #50
Comments
Maybe use gc_maxlifetime if cookie_lifetime is 0? |
I'm open to suggestions! Would be happy to accept a pullrq also :) |
I will definitely make a pullrq after we decide, how we handle this :-) For example Predis SessionHandler check only gc_maxlifetime or user defined value. For me this make sence. If cookie_lifetime is smaller than gc_maxlifetime, then use cookie_lifetime, if gc_maxlifetime is smaller than cookie_lifetime, then use cookie_lifetime and if cookie_lifetime is 0, then use gc_maxlifetime too. We can have session in redis longer than is neccesary, when user close browser before gc_maxlifetime, but I think, that we could life with it :-) |
I finally understood what is this issue about :) I should get more sleep more often. |
Yes, that is what I am talking about :-) Maybe I am not so good to describe it in english :-) I don't know if gc_maxlifetime can be zero. Because if it can, I don't know what time return for setEx. If it can't I agreed with you to choose the min but not zero. |
Ok, I have tested it and gc_maxlifetime can be set to 0. I can't image what PHP do when gc_maxlifetime is 0, but we need to deside what to do, if gc_maxlifetime = 0 and also cookie_lifetime = 0. Return Nette deafult gc_maxlifetime (3 hours) or PHP default gc_maxlifetime (1440s)? |
I would throw an exception if all the resulting time is 0, because that would be just stupid. |
You can always change that for session in config and the sessionhandler in kdyby/redis should pick that up. |
Fixed by #52 |
If you have set configuration session.cookie_lifetime = 0, getTtl() return 0 and setEX try to write 0 for expiration, but redis can't handle this.
The text was updated successfully, but these errors were encountered: