Forum Moderators: coopster

Message Too Old, No Replies

Session Warnings

... and still another question ....

         

Francis

6:31 am on Jul 26, 2005 (gmt 0)

10+ Year Member



I am getting this warning on my localhost.

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

I know that it is very straightforward, including on how to resolve it. However, my question is, what if our webhost would not want to change session.bug_compat_42 or session.bug_compat_warn to off? Any workaround?

g1smd

9:57 am on Jul 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could enable register_gloabals instead, but there are security issues around that if you are careless with the way you code your script.

jatar_k

4:53 pm on Jul 27, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I found this

[php.net...]

PHP versions 4.2.3 and lower have an undocumented feature/bug that allows you to initialize a session variable in the global scope, albeit register_globals is disabled. PHP 4.3.0 and later will warn you, if this feature is used, and if session.bug_compat_warn is also enabled. This feature/bug can be disabled by disabling this directive.

it would seem there may be something funny with how you are dealing with sessions, they should turn it off.

and turning register_globals on is not really a good idea.