Snippets

Create an account or login to be able to add, comment and rate snippets.

Navigation

Snippets by user Todd Eddy Snippets by user Todd Eddy

Easier method to choose domain and path for session cookie

This is an easier method of setting variables for the session cookie. It available in versions above v0.6.3 (1.0 betas and higher). Examples assume your front application name is called "frontend".

config/frontend/factories.yml:

storage:
    class: sfSessionStorage
    param:
      session_name:            MYAPP_SESSION
      session_cookie_lifetime: 77760000   # 90*24*3600
      session_cookie_path:     /
#      session_cookie_domain:   localhost
#      session_cookie_secure:   true

Comment/Uncomment what you need. That is all, there is no need to create a custom class. You may need to clear symfony's cache.

by Todd Eddy on 2007-01-22, tagged cookie  domain  factory  session  storage