Warning?
am 06.02.2010 17:29:48 von TedD
Hi:
Has anyone encountered this warning?
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
I seem to remember this happening before, but I don't remember the
solution. As I remember, it wasn't really reporting an error, but
something else. I just don't remember how I dealt with it before.
I don't know how to set session.bug_compat_warn to off.
Any ideas?
Cheers,
tedd
PS: I'm using php 5.2.10 and register_global is OFF.
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Warning?
am 06.02.2010 20:02:14 von Jochem Maas
Op 2/6/10 4:29 PM, tedd schreef:
> Hi:
>
> Has anyone encountered this warning?
>
> 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
>
> I seem to remember this happening before, but I don't remember the
> solution. As I remember, it wasn't really reporting an error, but
> something else. I just don't remember how I dealt with it before.
>
> I don't know how to set session.bug_compat_warn to off.
doesn't this work?:
otherwise you'll have to set it in php.ini (or a .htaccess file)
IIRC it means your using session_register() .. which is depreciated and
will be dropped in 5.3 ... AFAIK best practices is not to use this function
but instead assing to the $_SESSION superglobal.
e.g.
do:
instead of
>
> Any ideas?
>
> Cheers,
>
> tedd
>
> PS: I'm using php 5.2.10 and register_global is OFF.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Warning?
am 07.02.2010 16:40:53 von TedD
At 7:02 PM +0000 2/6/10, Jochem Maas wrote:
>Op 2/6/10 4:29 PM, tedd schreef:
>> Hi:
>>
>> Has anyone encountered this warning?
>>
>> 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
>>
>> I seem to remember this happening before, but I don't remember the
>> solution. As I remember, it wasn't really reporting an error, but
>> something else. I just don't remember how I dealt with it before.
>>
>> I don't know how to set session.bug_compat_warn to off.
>
>doesn't this work?:
>
>
>
>otherwise you'll have to set it in php.ini (or a .htaccess file)
>
>IIRC it means your using session_register() .. which is depreciated and
>will be dropped in 5.3 ... AFAIK best practices is not to use this function
>but instead assing to the $_SESSION superglobal.
Jochem:
Two things:
1. Your solution worked. Setting --
-- worked!!! Thank you.
2. I don't use session_register(). So has to be something else, but I
don't know what that might be.
Anyone have any ideas?
Daniel?
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Warning?
am 07.02.2010 17:15:30 von Shawn McKenzie
tedd wrote:
> Hi:
>
> Has anyone encountered this warning?
>
> 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
>
> I seem to remember this happening before, but I don't remember the
> solution. As I remember, it wasn't really reporting an error, but
> something else. I just don't remember how I dealt with it before.
>
> I don't know how to set session.bug_compat_warn to off.
>
> Any ideas?
>
> Cheers,
>
> tedd
>
> PS: I'm using php 5.2.10 and register_global is OFF.
This will reproduce the error:
session_start();
$_SESSION['test'] = null;
$test = 1;
It has something to do with using a global var that is the same name as
a session var, but the session var has to be null it seems.
--
Thanks!
-Shawn
http://www.spidean.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Warning?
am 07.02.2010 18:55:15 von Jochem Maas
Op 2/7/10 3:40 PM, tedd schreef:
> At 7:02 PM +0000 2/6/10, Jochem Maas wrote:
>> Op 2/6/10 4:29 PM, tedd schreef:
>>> Hi:
>>>
>>> Has anyone encountered this warning?
>>>
>>> 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
>>>
>>> I seem to remember this happening before, but I don't remember the
>>> solution. As I remember, it wasn't really reporting an error, but
>>> something else. I just don't remember how I dealt with it before.
>>>
>>> I don't know how to set session.bug_compat_warn to off.
>>
>> doesn't this work?:
>>
>>
>>
>> otherwise you'll have to set it in php.ini (or a .htaccess file)
>>
>> IIRC it means your using session_register() .. which is depreciated and
>> will be dropped in 5.3 ... AFAIK best practices is not to use this
>> function
>> but instead assing to the $_SESSION superglobal.
>
> Jochem:
>
> Two things:
>
> 1. Your solution worked. Setting --
>
>
>
> -- worked!!! Thank you.
np :)
>
> 2. I don't use session_register(). So has to be something else, but I
> don't know what that might be.
>
> Anyone have any ideas?
pretty sure Shawn nailed it.
>
> Daniel?
>
> Cheers,
>
> tedd
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Warning?
am 07.02.2010 19:11:14 von TedD
At 10:15 AM -0600 2/7/10, Shawn McKenzie wrote:
>tedd wrote:
>> Hi:
>>
>> Has anyone encountered this warning?
>>
>> 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
>>
>> I seem to remember this happening before, but I don't remember the
>> solution. As I remember, it wasn't really reporting an error, but
>> something else. I just don't remember how I dealt with it before.
>>
>> I don't know how to set session.bug_compat_warn to off.
>>
>> Any ideas?
>>
>> Cheers,
>>
>> tedd
>>
>> PS: I'm using php 5.2.10 and register_global is OFF.
>
>This will reproduce the error:
>
>session_start();
>$_SESSION['test'] = null;
>$test = 1;
>
>It has something to do with using a global var that is the same name as
>a session var, but the session var has to be null it seems.
>
>--
>Thanks!
>-Shawn
That's it! I remember now. I knew it was something simple and really stupid.
As it turns out, the problem here is that this error is NOT
consistent. Most of the time you don't need to worry about what you
name your variables and session variables. But every once in a while
if you are in the habit of naming variables the same name as session
variable (as I do), then the practice sometimes generates an error.
So to solve the above problem, all you have to do is use a different
variable name than the session name for that instance -- something
like:
session_start();
$_SESSION['session_test'] = null;
$test = 1;
But like I said, the error is only generated every once in a while
and NOT consistently. As such, you may have scores of variables that
match scores of sessions with no errors. But then you add just one
more and bingo you have an error that leaves you thinking "What the
Hell just happened?"
What is further maddening is that after you fix that error, by
changing then name of that conflict, you can go back to naming as you
like until another error is generated. It happens only once in a
while and not always.
Thanks for loaning me your memory.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php