Skip to content

Commit

Permalink
Merge pull request #5102 from Mogost/secure-prefix
Browse files Browse the repository at this point in the history
Enhancing the security of cookies
  • Loading branch information
browniebroke committed Jun 15, 2024
2 parents f9a4d86 + 310b803 commit bcd4437
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions {{cookiecutter.project_slug}}/config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@
SECURE_SSL_REDIRECT = env.bool("DJANGO_SECURE_SSL_REDIRECT", default=True)
# https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-secure
SESSION_COOKIE_SECURE = True
# https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-name
SESSION_COOKIE_NAME = "__Secure-sessionid"
# https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-secure
CSRF_COOKIE_SECURE = True
# https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-name
CSRF_COOKIE_NAME = "__Secure-csrftoken"
# https://docs.djangoproject.com/en/dev/topics/security/#ssl-https
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-seconds
# TODO: set this to 60 seconds first and then to 518400 once you prove the former works
Expand Down

0 comments on commit bcd4437

Please sign in to comment.