Home > Symfony Framework > How to make Symfony session to never timeout

How to make Symfony session to never timeout

March 26th, 2010

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: false

But 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);
  }
 
  // ...
}

Related posts:

  1. How to change CSRF attack message in Symfony 1.2 I wanted t

Related posts brought to you by Yet Another Related Posts Plugin.

Symfony Framework

  1. No comments yet.
  1. No trackbacks yet.
Subscribe to comments feed