Skip to content

Conversation

mentalstring
Copy link
Contributor

This replaces #215.

Since PHP 7.3 there's native support for SameSite cookies (RFC6265bis) which is available by using the newer session_get_cookie_params(), setcookie() and setrawcookie() function signatures. This PR enables is use in sfWebResponse::setCookie() and in sfSessionStorage.

The samesite parameter is optional, and when not provided (e.g. empty string), PHP simply doesn't use the SameSite cookie attribute, as in previous versions.

@mentalstring mentalstring force-pushed the samesite-cookies branch 2 times, most recently from 374c210 to b6d8656 Compare September 6, 2025 15:30
@mentalstring mentalstring changed the title Support for SameSite cookie session setting Support for SameSite cookie attribute Sep 6, 2025
@mentalstring mentalstring force-pushed the samesite-cookies branch 2 times, most recently from f224b54 to a0226e7 Compare September 11, 2025 14:13
@mentalstring mentalstring force-pushed the samesite-cookies branch 3 times, most recently from 1383188 to 947302f Compare September 16, 2025 17:38
mentalstring and others added 2 commits September 16, 2025 18:52
Starting from PHP 7.3 there's native support for SameSite cookies (RFC6265bis) which requires using a new session_get_cookie_params() parameter syntax.
@thePanz thePanz merged commit 052023a into FriendsOfSymfony1:master Sep 16, 2025
6 checks passed
@thePanz
Copy link
Member

thePanz commented Sep 16, 2025

Thanks @mentalstring , merged!

@mentalstring mentalstring deleted the samesite-cookies branch September 17, 2025 07:35
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