I created two user account modules - administrator and client. My current setup means that when I log in to the administrator, my application thinks that you are logged in as a client. The solution I decided was to create a session in which the cookie path is based on the admin URL, i.e. Set cookie_path as /administrator .
In my admin function Module.php onBootstrap I included:
$sessionConfig = new SessionConfig(); $sessionConfig->setOptions(['cookie_path' => '/administrator']); $sessionManager = new SessionManager($sessionConfig, null, null); Container::setDefaultManager($sessionManager);
which sets the path to the cookie, but this affects the entire application; that is, the rest of the site is a cookie because the URLs do not start with /administrator .
How to configure my application so that cookie_path for my admin module is different from other applications?
[edit]
What I get are two cookies: one for the admin route and one for the rest of the application.
[edit]
I am using Zend\Authentication\AuthenticationService for ACL. I am trying to get a user to go into the client section of a website and do something like that, and then go to the admin panel to do something.
As an example, Magento will set one cookie when working with a client account, and then another cookie when working with an administrator account.
How to configure Zend\Authentication\AuthenticationService to use a second session or url / module based cookie?
session-cookies zend-framework2 zend-session
Richard Parnaby-King
source share