Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/176254-session-side-effect-of-php-4/
Share on other sites

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.