26Mar/104
How to make Symfony session to never timeout
This is for Symfony 1.2 and sfGuardPlugin, but may be relevant for newer versions (1.3, 1.4, etc).
Setting timeout to false in factories.yml should've worked, e.g. like this:
all:
user:
class: myUser
param:
# this should have worked, but did not
timeout: falseBut it didn't work because I think 'false' did not get parsed as literal false.
Anyway, my hackish workaround is to add the following inside myUser.class.php:
class myUser extends sfGuardSecurityUser { public function initialize(sfEventDispatcher $dispatcher, sfStorage $storage, $options = array()) { // disable timeout $options['timeout'] = false; parent::initialize($dispatcher, $storage, $options); } // ... }
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
January 12th, 2011 - 08:06
Hello & Thank you very much, it also works with Symfony 1.4.
January 13th, 2011 - 09:30
anyway, I also had to change the php.ini value ‘session.gc_maxlifetime’ to 86400, as noticed in following posts : https://groups.google.com/group/symfony-fr/browse_thread/thread/ff3809d1cb655ff4?hl=fr
January 13th, 2011 - 09:42
Hi jb Heren,
Thanks for the info, it might come handy. Although, I don’t think I needed to change the php.ini to make it work.
September 26th, 2011 - 22:55
Hi,
i tried it out – but seems it doesnt really work (maybe its caused by the apostrophe plugin).