|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-06-27 17:06 UTC] michael dot babker at gmail dot com
Description: ------------ Within Joomla, our input retrieval and setting API accesses the superglobals by reference. It appears because of some of the engine refactoring, accessing the same data is not working the same way. In the case of Joomla, this is most evident in our session boot sequence (extracted into the test script below) where data validated in the $_COOKIE superglobal is no longer returned correctly. Test script: --------------- https://github.com/mbabker/session-test/blob/purephp/index.php Expected result: ---------------- On each execution of the script, the session counter should increment by one. Actual result: -------------- On each execution of the script, the session counter's value is one. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
I can confirm the issue. The following test script is sufficient to reproduce it: <?php $cookieData = &$_COOKIE; session_start(); var_dump($_SESSION); $_SESSION['foo'] = 'bar'; Apparently, the by-ref assignment causes a new session to be created on each request. @michael: The condition of the outermost if statement in your test script is always FALSE, because a variable can't be isset() and is_null().