feat: Allow shared cookies' domains to be set separately. (#28135)

Several of our cookies are meant to be shared between the LMS
and the marketing site. The previous assumption was that
SESSION_COOKIE_DOMAIN would cover both. We would like to make
it so that these can be set independently of each other.

https://openedx.atlassian.net/browse/ARCHBOM-1831
This commit is contained in:
Diana Huang
2021-07-12 15:49:11 -04:00
committed by GitHub
parent b6eb331436
commit 9173707a50
5 changed files with 16 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ def delete_logged_in_cookies(response):
response.delete_cookie(
cookie_name,
path='/',
domain=settings.SESSION_COOKIE_DOMAIN
domain=settings.SHARED_COOKIE_DOMAIN
)
return response
@@ -88,7 +88,7 @@ def standard_cookie_settings(request):
""" Returns the common cookie settings (e.g. expiration time). """
cookie_settings = {
'domain': settings.SESSION_COOKIE_DOMAIN,
'domain': settings.SHARED_COOKIE_DOMAIN,
'path': '/',
'httponly': None,
}