#109739Fix SameSite=None handling and ensure correct cookie removal attributes
Description
This patch fixes incorrect handling of cookie attributes in the core HTTP cookie service, ensuring valid SameSite behavior and consistent cookie removal.
## Fix:
#### 1. Invalid SameSite=None handling on non-HTTPS
SameSite=None cookies require the Secure flag and must only be used over HTTPS.
The previous implementation could force the Secure flag even on non-HTTPS requests, resulting in cookies being ignored by browsers.
This patch ensures:
- SameSite=None is only used on HTTPS requests
- fallback to SameSite=Strict on non-HTTPS requests
- Secure flag is only set when the request is HTTPS
#### 2. Incorrect cookie removal semantics
Cookie removal did not consistently preserve important attributes such as:
- domain / hostOnly
- Secure flag
- HttpOnly flag
- SameSite policy
Since browsers require exact attribute matching for deletion, this could result in cookies not being removed properly.
This patch ensures cookie removal uses consistent attributes, preventing stale cookies.
This issue was automatically created from https://github.com/TYPO3/typo3/pull/632
Reviews 1
Related issues 1
History 23
-
Gerrit Code Review pushed patch set 1 for main to change 93896 status
NewUnder Review <span data-processor="relativetime" data-value="2026-05-01T09:32:19+00:00" > 05/01/26, 09:32 </span> -
Oliver Hader changed Related to #107895 <span data-processor="relativetime" data-value="2026-05-02T16:19:07+00:00" > 05/02/26, 16:19 </span>
-
Georg Ringer commented and changed status
Under ReviewClosed <span data-processor="relativetime" data-value="2026-10-06T16:00:24+00:00" > 10/06/26, 16:00 </span>
Closing: the cookie removal attributes were already fixed with #107895, and silently downgrading a configured SameSite=None to Strict on HTTP would hide a misconfiguration and reverse its intent rather than fix it.