Bug #78858 [NEW]: session_set_cookie_params() can't be used with php_admin_*
| From: | pajomasoma at gmail dot com | Date: | Fri, 22 Nov 2019 17:03:28 +0000 |
| Subject: | Bug #78858 [NEW]: session_set_cookie_params() can't be used with php_admin_* | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-223860@lists.php.net to get a copy of this message | ||
From: pajomasoma at gmail dot com
Operating system: Linux
PHP version: 7.3.12
Package: PHP options/info functions
Bug Type: Bug
Bug description:session_set_cookie_params() can't be used with php_admin_*
Description:
------------
session_set_cookie_params() fails if one of the setting below has been
set by php_admin_flag/php_admin_value, even if not trying to change
them.
session.httponly
session.secure
session.samesite
Not clear if this is intended behavior. I expected to be able to use
session_set_cookie_params() if not trying to change from what was set by
php_admin_flag/php_admin_value. Instead, it fails, ignoring other values
that could have been set (see test script for samesite setting example).
Test script:
---------------
// php_admin_flag[session.cookie_httponly] = on
// php_admin_flag[session.cookie_secure] = on
print_r($cookieParams = session_get_cookie_params());
$cookieParams['samesite'] = 'Lax';
var_dump(session_set_cookie_params($cookieParams));
print_r(session_get_cookie_params());
Expected result:
----------------
Array
(
[lifetime] => 0
[path] => /
[domain] =>
[secure] => 1
[httponly] => 1
[samesite] =>
)
bool(true)
Array
(
[lifetime] => 0
[path] => /
[domain] =>
[secure] => 1
[httponly] => 1
[samesite] => Lax
)
Actual result:
--------------
Array
(
[lifetime] => 0
[path] => /
[domain] =>
[secure] => 1
[httponly] => 1
[samesite] =>
)
bool(false)
Array
(
[lifetime] => 0
[path] => /
[domain] =>
[secure] => 1
[httponly] => 1
[samesite] =>
)
--
Edit bug report at https://bugs.php.net/bug.php?id=78858&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78858&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78858&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78858&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78858&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78858&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78858&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78858&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78858&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78858&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78858&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78858&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78858&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78858&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78858&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78858&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78858&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78858&r=mysqlcfg