setAuthenticated in symfony for frontend and backend

The problem:

i had two applications 1) frontend and 2) backend.

but when i login into backend i was automatically login into the frontend application.

The Solution:

the solution is simple you have to define the session name for both the application or atleast one. so that the sessions for both of them differ from each other.

you can define the session name in the “\apps\backend\config\factories.yml” file

here

cli:
controller:
class: sfConsoleController
request:
class: sfConsoleRequest
response:
class: sfConsoleResponse

test:
storage:
class: sfSessionTestStorage

all:
#  controller:
#    class: sfFrontWebController
#
#  request:
#    class: sfWebRequest
#
#  response:
#    class: sfWebResponse
#
#  user:
#    class: myUser
#
storage:
class: sfSessionStorage
param:
session_name: symfonyBack
#
#  view_cache:
#    class: sfFileCache
#    param:
#      automaticCleaningFactor: 0
#      cacheDir:                %SF_TEMPLATE_CACHE_DIR%

i have given a name for the backend application (symfonyBack).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s