Search code examples
opencartopencart2.3

Logout from backend


I have several projects of opencart setup locally. When I login to backend of a project and then login to backend of another project, I get logged out of first project. Can someone tell me how can I fix this problem?


Solution

  • The session cookie is associated by your browser with the domain name. Solution is use different domain names - even on a local machine. Easiest way to do this is edit /etc/hosts and add your dev domain names there:

    127.0.0.1 example.com another-example.com yet-another-example.com
    

    If you do that, all three domains will point to your loopback ip and, assuming you have your webserver configured to handle traffic accordingly, your test domains will use distinct session cookies.