Posted by Thurein on 23rd February 2012

How to use separated sessions based on application in symfony

Currently, I’m playing with symfony mvc framework. In my current project is developing used by symfony and that’s have 2 app which are backend and frontend. But the project requirement is – these apps have to use their own session. So I separated the session in application level configuration as like follow -

In apps/backend/config/factories.yml

#apps/backend/config/factories.yml

all:

  ... # other configurations

  storage:
    class: sfSessionStorage
    param:
      session_name: backend_session

In apps/frontend/config/factories.yml

#apps/frontend/config/factories.yml

all:

  ... # other configurations

  storage:
    class: sfSessionStorage
    param:
      session_name: frontend_session

That all it is. Hope it useful for someone

  • About Thurein Soe
    Visit Thurein's website.

    Freelance Web Developer. Founder of The Tech Space. Follow me on Twitter.

  • No comments yet!

    Post your comments