the_little_mermaid Posted October 2, 2009 Share Posted October 2, 2009 Hi all I am getting this error in my php project. 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 Can anyone please tell me whats wrong and how to correct it. I do not have acces to the php.ini or httpd.conf file, So is there any other way to remove this error? Please let me know. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/176254-session-side-effect-of-php-4/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 2, 2009 Share Posted October 2, 2009 session.bug_compat_42 and session.bug_compat_warn can be set anywhere. .htaccess file (if php is running as an Apache Module) local php.ini (if php is running as a CGI appliction) in your script (though I doubt this will actually turn the warning off.) Edit: and you should contact your web host to get them to turn those settings off in the master php.ini, because there is ABSOLUTELY NO reason for those settings to be ON. Quote Link to comment https://forums.phpfreaks.com/topic/176254-session-side-effect-of-php-4/#findComment-928878 Share on other sites More sharing options...
PFMaBiSmAd Posted October 2, 2009 Share Posted October 2, 2009 I did some testing and the reason php.net probably put the 'bug compat' warning message in is because when register_globals are OFF and session.bug_compat_42 is ON (i.e. make the bug still work), session_register() still associates the named program variable with the session. It does not actually cause the value in the $_SESSION variable to change in the script, but when the session data file is saved, the value in the program variable is what is written to the session data file if you don't have an assignment statement setting the $_SESSION variable in the script. session_register() acts like a 'mini' register_globals for the one specific variable. This also means that the php documentation for session_register() incorrectly states it does not work when register_globals are OFF. Quote Link to comment https://forums.phpfreaks.com/topic/176254-session-side-effect-of-php-4/#findComment-929119 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.