Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set CSRF samesite cookie to 'None' #112

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions kobo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@
CSRF_TRUSTED_ORIGINS = [SESSION_COOKIE_DOMAIN]
CSRF_COOKIE_SECURE = True
ENKETO_CSRF_COOKIE_NAME = env.str('ENKETO_CSRF_COOKIE_NAME', '__csrf')
CSRF_COOKIE_SAMESITE = 'None'

SESSION_COOKIE_AGE = 60*60*24 # Session age is 24 hour
SESSION_SAVE_EVERY_REQUEST = True # Renew session every request made
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_SAMESITE = 'None'
SESSION_COOKIE_SAMESITE = 'None'

# Instances of this model will be treated as allowed origins; see
# https://github.com/ottoyiu/django-cors-headers#cors_model
Expand Down Expand Up @@ -788,7 +789,7 @@ def dj_stripe_request_callback_method():
]
CSP_FRAME_ANCESTORS = CSP_OC_SITES
CSP_CONNECT_SRC = CSP_CONNECT_SRC + CSP_OC_SITES
CSP_FRAME_SRC = CSP_FRAME_SRC + CSP_OC_SITES
CSP_FRAME_SRC = CSP_FRAME_SRC + CSP_OC_SITES

csp_report_uri = env.url('CSP_REPORT_URI', None)
if csp_report_uri: # Let environ validate uri, but set as string
Expand Down
Loading