|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-09-19 20:58 UTC] nicolas dot grekas+php at gmail dot com
Description: ------------ Per https://wiki.php.net/rfc/same-site-cookie setcookie should accept a 4th "array $options" argument. But this doesn't work. I didn't check the other function mentioned in the RFC so they might have the same issue. Test script: --------------- <?php setcookie('b', 'a', 0, array()); setcookie('b', 'a', 0, '/', '', false, false, 'lax'); See https://3v4l.org/52qe6 Expected result: ---------------- Warning: setcookie() expects at most 7 parameters, 8 given in /in/52qe6 on line 4 Actual result: -------------- Warning: setcookie() expects parameter 4 to be string, array given in /in/52qe6 on line 3 Warning: setcookie() expects at most 7 parameters, 8 given in /in/52qe6 on line 4 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 13:00:02 2025 UTC |
The expires argument was moved into the array, making the array argument be the third position. setcookie('b', 'a', array()); While there was some discussion about this happening, I'm not convinced there was a conclusion reached. Want to bring it up on the internals list?