Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Django Admin Sites on one Apache... When I log into one I get logged out of the other

I have two Django projects and applications running on the same Apache installation. Both projects and both applications have the same name, for example myproject.myapplication. They are each in separately named directories so it looks like .../dir1/myproject/myapplication and .../dir2/myproject/myapplication.

Everything about the actual public facing applications works fine. When I log into either of the admin sites it seems ok, but if I switch and do any work on the opposite admin site I get logged out of the first one. In short I can't be logged into both admin sites at once. Any help would be appreciated.


1 Answers

Set the SESSION_COOKIE_DOMAIN option. You need to set the domain for each of your sites so the cookies don't override each other.

You can also use SESSION_COOKIE_NAME to make the cookie names different for each site.

like image 190
2 revsstrager Avatar answered Oct 24 '25 20:10

2 revsstrager