|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-11-22 17:43 UTC] fgfgfgfdf at somewhere dot com
[2019-11-25 11:54 UTC] pajomasoma at gmail dot com
[2019-11-25 17:10 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
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] => )