PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > SESSION error -> Your script possibly relies on a session side-effectwhich existed until PHP 4.2.3.
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
SESSION error -> Your script possibly relies on a session side-effectwhich existed until PHP 4.2.3.

Réponse
 
LinkBack Outils de la discussion
Vieux 29/04/2008, 12h26   #1
Erwin Moller
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut SESSION error -> Your script possibly relies on a session side-effectwhich existed until PHP 4.2.3.

Hi group,

Does anybody know what causes the following 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
__________________________________________________

Since the whole projectcode is way too much to post here, I hope
somebody has a clue, so I know where to start looking.

It only happens on one Mac here in the office, and only at a certain page.
All other Sessionlogic works as intended, also on the Mac.

The server:
Apache1.3/PHP 4.3,
session.autostart is on.
Sessionstorage is files.
No register globals (of course).

The scripts use only code like this:
$_SESSION["bla"] = "something";
No session_register ancient stuff.

The Mac in question accepts .
The warning is reproducable.

I work a lot with sessions, and this is the first time I see this
warning on my own system.

Can anybody me?
Where to start bughunting?

I hate the fact the Warning says: "in Unknown on line 0", which isn't
ful at all of course.

Regards,
Erwin Moller
  Réponse avec citation
Vieux 29/04/2008, 12h33   #2
Erwin Moller
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SESSION error -> Your script possibly relies on a session side-effectwhich existed until PHP 4.2.3.

Erwin Moller schreef:

<snip>

Correction: It happens on all systems (also Windows on FF).
(luckily)

Looking into it myself now, but didn't find a thing yet. :-/

Erwin Moller
  Réponse avec citation
Vieux 29/04/2008, 12h43   #3
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SESSION error -> Your script possibly relies on a session side-effect which existed until PHP 4.2.3.

On Tue, 29 Apr 2008 13:33:19 +0200, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote:

> Erwin Moller schreef:
>
> <snip>
>
> Correction: It happens on all systems (also Windows on FF).
> (luckily)
>
> Looking into it myself now, but didn't find a thing yet. :-/
>
> Erwin Moller


Does this trigger it:
<?php
ini_set('session.bug_compat_warn',1);
ini_set('session.bug_compat_42',1);
session_start();
$_SESSION['foo'] = NULL;
$foo = "foo";
?>

If so, the warning will _not_ appear:
- if $_SESSION['foo'] exists and is not null
- there's no global variable named $foo

Lousy error message BTW. Just act as usual I'd say, turn of
session.bug_compat_warn & session.bug_compat_42.
--
Rik Wasmus
  Réponse avec citation
Vieux 29/04/2008, 13h18   #4
Erwin Moller
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SESSION error -> Your script possibly relies on a session side-effectwhich existed until PHP 4.2.3.

Rik Wasmus schreef:
> On Tue, 29 Apr 2008 13:33:19 +0200, Erwin Moller
> <Since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote:
>
>> Erwin Moller schreef:
>>
>> <snip>
>>
>> Correction: It happens on all systems (also Windows on FF).
>> (luckily)
>>
>> Looking into it myself now, but didn't find a thing yet. :-/
>>
>> Erwin Moller

>
> Does this trigger it:
> <?php
> ini_set('session.bug_compat_warn',1);
> ini_set('session.bug_compat_42',1);
> session_start();
> $_SESSION['foo'] = NULL;
> $foo = "foo";
> ?>


Yes, it does trigger it.
(I had to remove session_start() because that added another warning
since I had autostart on on the machine)

>
> If so, the warning will _not_ appear:
> - if $_SESSION['foo'] exists and is not null
> - there's no global variable named $foo


Aha, now I get the error.

Let me summarize: PHP is wasting time by checking if I use variablenames
in my script that exists as a key in the $_SESSION?
Jeeez... What a waste of CPU resources. :P

I am surprised I never had this warning before, since I NEVER paid any
attention to similarity in names in SESSION and my scriptvars. ;-)

>
> Lousy error message BTW. Just act as usual I'd say, turn of
> session.bug_compat_warn & session.bug_compat_42.


Thanks Rik for your clear and fast reply.

And yes, very lousy description of the error/warning indeed.

I'll immediately change the php.ini to surpress these nonsense warnings.

Thanks.

Erwin Moller
  Réponse avec citation
Vieux 29/04/2008, 13h35   #5
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SESSION error -> Your script possibly relies on a session side-effect which existed until PHP 4.2.3.

On Tue, 29 Apr 2008 14:18:50 +0200, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote:

> Rik Wasmus schreef:
>> On Tue, 29 Apr 2008 13:33:19 +0200, Erwin Moller
>> <Since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote:
>>
>>> Erwin Moller schreef:
>>>
>>> <snip>
>>>
>>> Correction: It happens on all systems (also Windows on FF).
>>> (luckily)
>>>
>>> Looking into it myself now, but didn't find a thing yet. :-/
>>>
>>> Erwin Moller

>> Does this trigger it:
>> <?php
>> ini_set('session.bug_compat_warn',1);
>> ini_set('session.bug_compat_42',1);
>> session_start();
>> $_SESSION['foo'] = NULL;
>> $foo = "foo";
>> ?>

>
> Yes, it does trigger it.
> (I had to remove session_start() because that added another warning
> since I had autostart on on the machine)


Euhm, doh, yes offcourse .

>> If so, the warning will _not_ appear:
>> - if $_SESSION['foo'] exists and is not null
>> - there's no global variable named $foo

>
> Aha, now I get the error.
>
> Let me summarize: PHP is wasting time by checking if I use variablenames
> in my script that exists as a key in the $_SESSION?
> Jeeez... What a waste of CPU resources. :P


Indeed, what a waste. I suspect turning of session.bug_compat_42 will halt
that checking.

> I am surprised I never had this warning before, since I NEVER paid any
> attention to similarity in names in SESSION and my scriptvars. ;-)


As you shouldn't have to (and global variables should be few
offcourse...)

>> Lousy error message BTW. Just act as usual I'd say, turn of
>> session.bug_compat_warn & session.bug_compat_42.

>
> Thanks Rik for your clear and fast reply.
>
> And yes, very lousy description of the error/warning indeed.
>
> I'll immediately change the php.ini to surpress these nonsense warnings.


Nonsense indeed, amen.
--
Rik Wasmus
  Réponse avec citation
Vieux 29/04/2008, 14h00   #6
Erwin Moller
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SESSION error -> Your script possibly relies on a session side-effectwhich existed until PHP 4.2.3.

Rik Wasmus schreef:

<snip>

>> I'll immediately change the php.ini to surpress these nonsense warnings.

>
> Nonsense indeed, amen.


Hi Rik,

I include an ini_set routine in all my projects these days, and added
them over there. Now the warning is gone. :-)

And now for the fun part:
session.bug_compat_42 or session.bug_compat_warn both don't exists in my
php.ini. sigh.
Am I expected to just add them?

I am used to changing ini values, but never added new ones before.
(and this is a productionserver)
Do you think I could just add them, kick Apache, and be done with it?

Regards,
Erwin Moller
  Réponse avec citation
Vieux 29/04/2008, 14h09   #7
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SESSION error -> Your script possibly relies on a session side-effect which existed until PHP 4.2.3.

On Tue, 29 Apr 2008 15:00:35 +0200, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote:

> Rik Wasmus schreef:
>
> <snip>
>
>>> I'll immediately change the php.ini to surpress these nonsense
>>> warnings.

>> Nonsense indeed, amen.

>
> Hi Rik,
>
> I include an ini_set routine in all my projects these days, and added
> them over there. Now the warning is gone. :-)
>
> And now for the fun part:
> session.bug_compat_42 or session.bug_compat_warn both don't exists in my
> php.ini. sigh.
> Am I expected to just add them?
>
> I am used to changing ini values, but never added new ones before.
> (and this is a productionserver)
> Do you think I could just add them, kick Apache, and be done with it?


Sure, lots of values aren't specifically set in many normal php.ini, so
they just take the default (which sadly in this case would be "on" for
both of them). Just set them & reload Apache.
--
Rik Wasmus
  Réponse avec citation
Vieux 29/04/2008, 15h42   #8
Erwin Moller
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SESSION error -> Your script possibly relies on a session side-effectwhich existed until PHP 4.2.3.

Rik Wasmus schreef:
> On Tue, 29 Apr 2008 15:00:35 +0200, Erwin Moller
> <Since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote:
>
>> Rik Wasmus schreef:
>>
>> <snip>
>>
>>>> I'll immediately change the php.ini to surpress these nonsense
>>>> warnings.
>>> Nonsense indeed, amen.

>>
>> Hi Rik,
>>
>> I include an ini_set routine in all my projects these days, and added
>> them over there. Now the warning is gone. :-)
>>
>> And now for the fun part:
>> session.bug_compat_42 or session.bug_compat_warn both don't exists in
>> my php.ini. sigh.
>> Am I expected to just add them?
>>
>> I am used to changing ini values, but never added new ones before.
>> (and this is a productionserver)
>> Do you think I could just add them, kick Apache, and be done with it?

>
> Sure, lots of values aren't specifically set in many normal php.ini, so
> they just take the default (which sadly in this case would be "on" for
> both of them). Just set them & reload Apache.


Thx again.
Worked like a charm. :-)

Regards,
Erwin Moller
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 06h07.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17111 seconds with 16 queries