From: tedd on
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
From: Jochem Maas on
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?:

<?php ini_set('session.bug_compat_warn', 0); ?>

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:

<?php $_SESSION['foo'] = $foo; // assumes session_start() has already been called

instead of

<?php session_register('foo', $foo); // automatically calls session_start() if not already started.

>
> Any ideas?
>
> Cheers,
>
> tedd
>
> PS: I'm using php 5.2.10 and register_global is OFF.

From: tedd on
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?:
>
> <?php ini_set('session.bug_compat_warn', 0); ?>
>
>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 --

<?php ini_set('session.bug_compat_warn', 0); ?>

-- 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
From: Shawn McKenzie on
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
From: Jochem Maas on
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?:
>>
>> <?php ini_set('session.bug_compat_warn', 0); ?>
>>
>> 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 --
>
> <?php ini_set('session.bug_compat_warn', 0); ?>
>
> -- 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
>