fix cookie stuff?

This commit is contained in:
Holger Sielaff
2025-09-04 09:52:23 +02:00
parent 26fce651b1
commit c5e7e3739f
3 changed files with 10 additions and 3 deletions

View File

@@ -1,12 +1,15 @@
from django.conf import settings
from django_proxmox_mikrotik.settings import ADMIN_BASE_URL
class FrontendSessionMiddleware:
def __init__(self, get_response):
self.get_response = get_response
self.default_session_cookie_name = 'sessionid'
def __call__(self, request):
if request.path.startswith('/frontend/'):
if not request.path.startswith(ADMIN_BASE_URL):
settings.SESSION_COOKIE_NAME = settings.SESSION_COOKIE_NAME_FRONTEND
else:
settings.SESSION_COOKIE_NAME = self.default_session_cookie_name