Skip to content

Conversation

@GuySartorelli
Copy link
Member

Comment on lines -849 to -860
We also want to ensure cookies are not shared between secure and non-secure sessions, so we must tell Silverstripe CMS to
use a [secure session](/developer_guides/cookies_and_sessions/sessions/#secure-session-cookie).
To do this, you may set the `cookie_secure` parameter to `true` in your `config.yml` for `Session`.

It is also a good idea to set the `samesite` attribute for the session cookie to `Strict` unless you have a specific use case for
sharing the session cookie across domains.

```yml
SilverStripe\Control\Session:
cookie_samesite: 'Strict'
cookie_secure: true
```
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part should have been updated as part of #712.
I've opted to remove it, and instead just make sure this section links to the sessions docs, which includes this information.


Clears a given cookie.

The same values used for `$path`, `$domain`, `$secure`, `$httpOnly`, and `$sameSite` when seting the cookie should be used here as well.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The same values used for `$path`, `$domain`, `$secure`, `$httpOnly`, and `$sameSite` when seting the cookie should be used here as well.
The same values used for `$path`, `$domain`, `$secure`, `$httpOnly`, and `$sameSite` when setting the cookie should be used here as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@GuySartorelli GuySartorelli force-pushed the pulls/6.0/cookie-samesite branch from d6985ee to ce96f6c Compare March 12, 2025 03:49
@GuySartorelli GuySartorelli force-pushed the pulls/6.0/cookie-samesite branch from ce96f6c to 19f9713 Compare March 12, 2025 22:32
@emteknetnz emteknetnz merged commit 13e5bff into silverstripe:6.0 Mar 13, 2025
3 checks passed
@emteknetnz emteknetnz deleted the pulls/6.0/cookie-samesite branch March 13, 2025 21:20
GuySartorelli added a commit to creative-commoners/developer-docs that referenced this pull request Mar 14, 2025
GuySartorelli added a commit to creative-commoners/developer-docs that referenced this pull request Mar 14, 2025
GuySartorelli added a commit to creative-commoners/developer-docs that referenced this pull request Mar 14, 2025
GuySartorelli added a commit to creative-commoners/developer-docs that referenced this pull request Mar 14, 2025
GuySartorelli added a commit to creative-commoners/developer-docs that referenced this pull request Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants