Skip to content

Commit d4764ec

Browse files
authored
Merge pull request #1224 from NHSDigital/disable-secure-cookies-on-local
Allow overriding secure cookies for local development
2 parents a33763f + 01fe05d commit d4764ec

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

manage_breast_screening/config/.env.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ DATABASE_HOST=localhost
1111
LOG_QUERIES=0
1212
PERSONAS_ENABLED=1
1313

14+
CSRF_COOKIE_SECURE=False
15+
SESSION_COOKIE_SECURE=False
16+
1417
# Set to FQDN in deployed environments
1518
BASE_URL=http://localhost:8000
1619

manage_breast_screening/config/settings/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def list_env(key):
3737
ALLOWED_HOSTS = list_env("ALLOWED_HOSTS")
3838
CSRF_TRUSTED_ORIGINS = list_env("CSRF_TRUSTED_ORIGINS")
3939

40-
CSRF_COOKIE_SECURE = True
41-
SESSION_COOKIE_SECURE = True
40+
CSRF_COOKIE_SECURE = boolean_env("CSRF_COOKIE_SECURE", default=True)
41+
SESSION_COOKIE_SECURE = boolean_env("SESSION_COOKIE_SECURE", default=True)
4242
# SECURE_SSL_REDIRECT is set to False because TLS termination is handled at the Azure Container Apps layer
4343
SECURE_SSL_REDIRECT = False
4444

0 commit comments

Comments
 (0)