note 126348 added to function.setcookie
| From: | j at main dot php dot net | Date: | Wed, 18 Aug 2021 10:16:16 +0000 |
| Subject: | note 126348 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216802@lists.php.net to get a copy of this message | ||
In versions below 7.4 to add "samesite" param to cookie, you can add it on $path value.
<?php
setcookie('foo','1',(time() + 86400), '/; samesite=lax',
'www.example.com',false,false);
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 82.213.218.165)
----
Manual Page -- https://php.net/manual/en/function.setcookie.php
Edit -- https://main.php.net/note/edit/126348
Del: integrated -- https://main.php.net/note/delete/126348/integrated
Del: useless -- https://main.php.net/note/delete/126348/useless
Del: bad code -- https://main.php.net/note/delete/126348/bad+code
Del: spam -- https://main.php.net/note/delete/126348/spam
Del: non-english -- https://main.php.net/note/delete/126348/non-english
Del: in docs -- https://main.php.net/note/delete/126348/in+docs
Del: other reasons-- https://main.php.net/note/delete/126348
Reject -- https://main.php.net/note/reject/126348
Search -- https://main.php.net/manage/user-notes.php