4
votes

I am trying to find where Symfony is setting a cookie. When I visit my site (I'm using the sfDoctrineGuard plugin) I get the login page, which is the expected behaviour. When viewing the cookies that have been created, there is a 'symfony' cookie. I can't find where Symfony is setting this cookie... I need to change the expiry time.

The only places that I see setCookie being used is for the Remember Me key but this is a separate cookie altogether.

The other problem is that for some reason, the expiry time for the 'symfony' cookie is showing as "Session" in Safari, and not a date/time.

I'm pretty sure this has nothing to do with sfDoctrineGuard, and that Symfony always creates a cookie when a user visits the site, just need to find the code that is setting this cookie.

Any ideas?

2

2 Answers

4
votes

You can change the timeout of the session in the factories.yml

storage:
  class: sfSessionStorage
  param:
    session_name: symfony
    session_cookie_lifetime: 60000 # number of seconds

Documentation here

1
votes

On your factories.yml try

all:
  storage:
    class: sfSessionStorage
    param:
      session_name:            The cookie name (symfony by default)
      session_id:              The session id (null by default)
      auto_start:              Whether to start the session (true by default)
      session_cookie_lifetime: Cookie lifetime
      session_cookie_path:     Cookie path
      session_cookie_domain:   Cookie domain
      session_cookie_secure:   Cookie secure
      session_cookie_httponly: Cookie http only (only for PHP >= 5.2)