Fix #3701 -- Don't use static cookie_domain on custom domains (#3728)

This commit is contained in:
Mira
2023-11-20 11:33:45 +01:00
committed by GitHub
parent 78609613bc
commit 65dbf03a12
2 changed files with 4 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ from django.utils.http import url_has_allowed_host_and_scheme
from django.views.generic import View
from pretix.helpers.cookies import set_cookie_without_samesite
from pretix.multidomain.middlewares import get_cookie_domain
from .robots import NoSearchIndexViewMixin
@@ -62,7 +63,7 @@ class LocaleSet(NoSearchIndexViewMixin, View):
max_age=max_age,
expires=(datetime.utcnow() + timedelta(seconds=max_age)).strftime(
'%a, %d-%b-%Y %H:%M:%S GMT'),
domain=settings.SESSION_COOKIE_DOMAIN
domain=get_cookie_domain(request)
)
return resp