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

Make session secure by default #11597

Open
4 tasks
GuySartorelli opened this issue Feb 7, 2025 · 2 comments
Open
4 tasks

Make session secure by default #11597

GuySartorelli opened this issue Feb 7, 2025 · 2 comments

Comments

@GuySartorelli
Copy link
Member

In https://docs.silverstripe.org/en/developer_guides/cookies_and_sessions/sessions/#cookies there is clear guidance for how to make a session secure - but that should be the default. Developers can then loosen that as needed for their circumstances.

We should tighten this up in CMS 6 - we can't do it sooner than that for BC reasons.

Acceptance criteria

  • Session.cookie_samesite configuration property is set to 'Strict' by default
  • Session.cookie_secure configuration property is set to true by default
  • Documentation is updated to reflect the new defaults, and to say how to loosen them (and an example of an appropriate scenario in which to do that, or if no such scenario is discovered, a warning to not do it unless they're sure they know what they're doing)
  • Changelog clearly calls out this change and how to revert it if needed
@lekoala
Copy link
Contributor

lekoala commented Feb 25, 2025

just a quick note that in dev mode, having strict and secure cookie can be annoying, so if it's possible to make that the default only for live mode, that would be great :-)

@GuySartorelli
Copy link
Member Author

GuySartorelli commented Feb 25, 2025

It's very unlikely we'd have this differ in Dev mode or be only in live mode, for the same reason CanonicalUrlMiddleware will be enabled in all environments by default - it would be annoying for things to work great in Dev but then you deploy and nobody can log in or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants