|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-06-28 18:39 UTC] akukin at ihug dot co dot nz
Description: ------------ 1. After running the following source code I get: ================================================ Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 ================================================ I expect no such warning as I am not using any register_globals etc I am only using the suggested session handling API: session_start & $_SESSION array. 2. Also found: By changing the last 2 lines to: //$_SESSION["test"] = NULL; unset($_SESSION["test"]); warning disappears. By changing "$test = " to "$test2 = " warning disappears either. Shall it be the feature I would appreciate if you send me an explanation of this feature as it does not make any sense to me. Reproduce code: --------------- <? session_start(); $test = isset($_SESSION["test"]) ? $_SESSION["test"] : "test"; $_SESSION["test"] = NULL; //unset($_SESSION["test"]); ?> Expected result: ---------------- I expect not to have this warning as I am not using any register_globals etc I am only using the suggested session handling API: session_start & $_SESSION array. Actual result: -------------- Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 13:00:01 2025 UTC |
Is register_globals on or off? Try this: <?php echo ini_get('register_globals'); ?>