Skip to content

Commit e48264c

Browse files
fix: replace deprecated DCS session cookie settings
Use Django's native SESSION_COOKIE_SAMESITE and remove dead DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL settings (Fixes #38757). Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 279e164 commit e48264c

3 files changed

Lines changed: 3 additions & 10 deletions

File tree

lms/envs/common.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -989,9 +989,8 @@
989989

990990
############################### DJANGO BUILT-INS ###############################
991991

992-
# django-session-cookie middleware
993-
DCS_SESSION_COOKIE_SAMESITE = 'None'
994-
DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL = True
992+
# django-session-cookie middleware (deprecated DCS_* settings removed; see #38757)
993+
SESSION_COOKIE_SAMESITE = 'None'
995994

996995
# LMS base
997996
LMS_BASE = 'localhost:18000'

lms/envs/devstack.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,7 @@ def should_show_debug_toolbar(request): # pylint: disable=missing-function-docs
474474

475475
#####################################################################
476476

477-
# django-session-cookie middleware
478-
DCS_SESSION_COOKIE_SAMESITE = 'Lax'
479-
DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL = True
477+
SESSION_COOKIE_SAMESITE = 'Lax'
480478

481479
########################## THEMING #######################
482480
# If you want to enable theming in devstack, uncomment this section and add any relevant

lms/envs/production.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ def get_env_setting(setting):
132132

133133
DATA_DIR = path(DATA_DIR) # noqa: F405
134134

135-
# TODO: This was for backwards compatibility back when installed django-cookie-samesite (not since 2022).
136-
# The DCS_ version of the setting can be DEPR'd at this point.
137-
SESSION_COOKIE_SAMESITE = DCS_SESSION_COOKIE_SAMESITE # noqa: F405
138-
139135
for feature, value in _YAML_TOKENS.get('FEATURES', {}).items():
140136
FEATURES[feature] = value
141137

0 commit comments

Comments
 (0)