session side effect session.bug_compat_42 or session.bug_compat_warn

PHP Add comments

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

This error likely appears when setting some thing like this $_SESSION['something'] = NULL; or you are assigning a variables value to a session which is null. hopefully.

what people say is better turn off this warning by
 
1. "session.bug_compat_42 = 0" in your php.ini
 
2. setting the following in your .htaccess file
    php_flag session.bug_compat_42 0
    php_flag session.bug_compat_warn 0
 
3. Directly write the following code in your php script where you want to 
stop the warning. It is better if you set it in a common include file.
 
ini_set('session.bug_compat_42',0);
ini_set('session.bug_compat_warn',0);
...

3 Responses to “session side effect session.bug_compat_42 or session.bug_compat_warn”

  1. Kuhueit Says:

    Thanks!

  2. Miki Says:

    I choose to edit the .htaccess file. It works! Thank you.

  3. sheetal Says:

    i wrote code in php script. it works.. Thank u…

Leave a Reply

Entries RSS