Bug #76688 [NEW]: Cookie $options should not allow further arguments
| From: | cmb@php.net | Date: | Tue, 31 Jul 2018 21:17:44 +0000 |
| Subject: | Bug #76688 [NEW]: Cookie $options should not allow further arguments | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-216532@lists.php.net to get a copy of this message | ||
From: cmb
Operating system: *
PHP version: 7.3Git-2018-07-31 (Git)
Package: Network related
Bug Type: Bug
Bug description:Cookie $options should not allow further arguments
Description:
------------
The support for SameSite cookie directives[1] introduced $option
parameters for setcookie(), setrawcookie() and
session_set_cookie_params(), but these appear to allow further
arguments to be passed, which does not appear to conform to the
respective RFC[2], and is generally confusing.
[1] <https://github.com/php/php-src/pull/3398>
[2] <https://wiki.php.net/rfc/same-site-cookie#proposal>
Test script:
---------------
<?php
session_set_cookie_params(array('path'=>'/foo/'), 'bar',
'www.example.com');
var_dump(session_get_cookie_params());
Expected result:
----------------
A warning regarding excess arguments, which should be ignored for
further processing.
Actual result:
--------------
array(6) {
["lifetime"]=>
int(0)
["path"]=>
string(5) "/foo/"
["domain"]=>
string(15) "www.example.com"
["secure"]=>
bool(false)
["httponly"]=>
bool(false)
["samesite"]=>
string(0) ""
}
--
Edit bug report at https://bugs.php.net/bug.php?id=76688&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76688&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76688&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76688&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76688&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76688&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76688&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76688&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76688&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76688&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76688&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76688&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76688&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76688&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76688&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76688&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76688&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76688&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76688&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76688&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76688&r=mysqlcfg