initial
This commit is contained in:
15
frontend/middleware.py
Normal file
15
frontend/middleware.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from django.conf import settings
|
||||
|
||||
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/'):
|
||||
settings.SESSION_COOKIE_NAME = settings.SESSION_COOKIE_NAME_FRONTEND
|
||||
else:
|
||||
settings.SESSION_COOKIE_NAME = self.default_session_cookie_name
|
||||
|
||||
response = self.get_response(request)
|
||||
return response
|
||||
Reference in New Issue
Block a user