Rui Gonçalves
Rui Gonçalves

Reputation: 2433

How to increase the session timeout in Symfony

I would like to know how to increase the session timeout in symfony. Is it enough to only adjust the symfony configuration settings or must I also configure anything in my php.ini file?

Upvotes: 18

Views: 21872

Answers (2)

greg
greg

Reputation: 6913

For Symfony 2.0.x

framework:
    session:
        lifetime: 43200  #time in seconds

For Symfony >= 2.1.0

framework:
    session:
        cookie_lifetime: 43200  #time in seconds

Upvotes: 29

Raise
Raise

Reputation: 2034

for sf1.0:

Change the value in apps/appname/config/settings.yml:

all:
  .settings:
    timeout:    1800 #session lifetime value in seconds

for sf1.1+:

Add these lines to apps/appname/config/factories.yml:

user:
  class: myUser
  param:
    timeout:    1800 #session lifetime value in seconds

Upvotes: 9

Related Questions