-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
CMemCache stop working after upgrade to 1.1.11 because of wrong expire time #1066
Comments
According to the PHP manual it should not become broken: http://www.php.net/manual/en/memcached.expiration.php Quote:
Investigating this. |
@SonicGD Could you please explain what value you're passing to the cache application component?
What is the exact value returned by Btw, testing myself. |
Yeah, problem in timeout. In main.php config session timeout is 31536000. So as when i do var_dump($this->getTimeout()); So it applies as unixts. I just need to reduce it. But this is kind of undefined behavior. Maybe setValue shoud check for expire range? Or just mention it here - http://www.yiiframework.com/doc/api/1.1/CCacheHttpSession/ or here - http://www.yiiframework.com/doc/api/1.1/CMemCache/? |
@SonicGD Yes, now i understand the problem. A note to be even more clear for other people reading this issue: your value is 31536000, max possible value is 2592000 (according to the PHP manual). Therefore memcache treats your value as absolute UNIX timestamp (of course 31536000 is less than current timestamp), not the difference (delta time) in seconds as you want. @samdark @mdomba I don't think this is a very critical issue thus we can fix it in 1.1.12. Fixing and refinement PR will be ready soon. |
Seems not critical but many users can be affected if they have the expiration time > 30 days. For now I will open a Yii 1.1.11 known issues on the Yii forum -> anouncements so other users get noticed about this |
We can mention it in release announcement as well. |
After upgrade to 1.1.11 i notice that all my cache not working so i even can't login into my app because i use CCacheHttpSession. After some investigation i detected, that problem have place because this code was deleted:
from setValue and addValue methods of CMemCache. So session data saves with expiration time in past:
return $this->_cache->set($this->calculateKey($id),$data,$this->getTimeout()); //my session.gc_maxlifetime is 14400
I returned this "time shifting" code back and all work as it should.
The text was updated successfully, but these errors were encountered: