Bug #76906 [NEW]: setcookie() doesn't handle "samesite" attribute while the RFC says it should

From: Date: Wed, 19 Sep 2018 20:58:26 +0000
Subject: Bug #76906 [NEW]: setcookie() doesn't handle "samesite" attribute while the RFC says it should
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217144@lists.php.net to get a copy of this message
From: nicolas dot grekas+php at gmail dot com Operating system: PHP version: 7.3.0RC1 Package: Scripting Engine problem Bug Type: Bug Bug description:setcookie() doesn't handle "samesite" attribute while the RFC says it should 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 -- Edit bug report at https://bugs.php.net/bug.php?id=76906&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76906&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76906&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76906&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76906&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76906&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76906&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76906&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76906&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76906&r=support Expected behavior: https://bugs.php.net/fix.php?id=76906&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76906&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76906&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76906&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76906&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76906&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76906&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76906&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76906&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76906&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76906&r=mysqlcfg

« previous php.bugs (#217144) next »