jwallace.us

tech, tunes, and other stuff

Warning: Unknown: Your Script Possibly Relies on a Session Side-effect...

If you get this error in PHP:

  • 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*

It is because you have assigned a session variable with a NULL value, and then have assigned a value to a  variable with the same name in the global scope.  For example:

1
2
3
4
5
<?php
   session_start();
   $_SESSION['test'] = NULL;
   $test = "This example will generate an error.";
?>