doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

setcookie() 'samesite' option bugging

Open Heraes-git opened this issue 4 months ago • 5 comments

From manual page: https://php.net/function.setcookie


This works :

$cookie_options = array('expires' => $max_expiration, 'path' => '/', 'domain' => '', 'secure' => false, 'httponly' => false);
setcookie("Sondage01", $cookie_value_string, $cookie_options);

This doesn't work :

$cookie_options = array('expires' => $max_expiration, 'path' => '/', 'domain' => '', 'secure' => false, 'httponly' => false, 'samesite' => 'None');
setcookie("Sondage01", $cookie_value_string, $cookie_options);

Test page here : https://pastebin.com/5Bu8G225 Uncomment line 5 to make it work again.

Heraes-git avatar Sep 11 '25 11:09 Heraes-git