ID: 24380
Updated by: [EMAIL PROTECTED]
Reported By: akukin at ihug dot co dot nz
-Status: Open
+Status: Bogus
Bug Type: Session related
Operating System: win2k & linux
PHP Version: 4.3.2
New Comment:
Just set "session.bug_compat_42 = 0" in your php.ini.
(or if you're using apache, in .htaccess file, using php_value)
The error message clearly says:
"..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.."
And btw. correct way to unset session variables is to use 'unset()',
and this error message actually tells you that you're doing something
wrong.
Previous Comments:
------------------------------------------------------------------------
[2003-06-28 20:54:32] [EMAIL PROTECTED]
Is register_globals on or off? Try this:
<?php echo ini_get('register_globals'); ?>
------------------------------------------------------------------------
[2003-06-28 18:39:40] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24380&edit=1