Thread: Strange warning message

Strange warning message

From
Lynna Landstreet
Date:
Hi there,

I just got the following warning message at the bottom of one of my PHP
pages, which ran with no problems up until very recently:

   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 think possibly our server was just upgraded or something. But does anyone
know what this means? The script in question does use sessions, but I'm not
sure what it means by "session side-effect". Could this be from trying to
read in variables posted via a form into the session? I've been doing that
all along, and it never gave me any problems until now...


Lynna

--
Resource Centre Database Coordinator
Gallery 44: www.gallery44.org
Database Project: www.gallery44db.org



Re: Strange warning message

From
Lynna Landstreet
Date:
on 7/28/04 3:21 PM, Lynna Landstreet at lynna@gallery44.org wrote:

> 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

An additional comment - I was reading more about register_globals just now,
and I don't think anything in my script relies on that, at least not as I
understand it. The page this error came up on does have a session_start() at
the beginning but doesn't actually call any session variables. It does
extract the visitor's username from a previously set cookie to see if
they're logged in, but it references that as $_COOKIE['username'] which as
far as I understand is legitimate. It doesn't use any uninitialized
variables.

Any ideas?


Lynna

--
Resource Centre Database Coordinator
Gallery 44: www.gallery44.org
Database Project: www.gallery44db.org



Re: Strange warning message

From
"Chris"
Date:
This post might help you...

http://marc.theaimsgroup.com/?l=php-general&m=104202443607420&w=2

(or these -
http://marc.theaimsgroup.com/?l=php-general&r=1&w=2&q=b&s=Your+script+po
ssibly+relies+on+a+session+side-effect ).


-----Original Message-----
From: pgsql-php-owner@postgresql.org
[mailto:pgsql-php-owner@postgresql.org] On Behalf Of Lynna Landstreet
Sent: Thursday, July 29, 2004 5:53 AM
To: pgsql-php@postgresql.org
Subject: Re: [PHP] Strange warning message


on 7/28/04 3:21 PM, Lynna Landstreet at lynna@gallery44.org wrote:

> 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

An additional comment - I was reading more about register_globals just
now, and I don't think anything in my script relies on that, at least
not as I understand it. The page this error came up on does have a
session_start() at the beginning but doesn't actually call any session
variables. It does extract the visitor's username from a previously set
cookie to see if they're logged in, but it references that as
$_COOKIE['username'] which as far as I understand is legitimate. It
doesn't use any uninitialized variables.

Any ideas?


Lynna

--
Resource Centre Database Coordinator
Gallery 44: www.gallery44.org
Database Project: www.gallery44db.org



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly


Re: Strange warning message

From
Lynna Landstreet
Date:
on 7/28/04 7:55 PM, Chris at chris@interspire.com wrote:

> This post might help you...
>
> http://marc.theaimsgroup.com/?l=php-general&m=104202443607420&w=2
>
> (or these -
> http://marc.theaimsgroup.com/?l=php-general&r=1&w=2&q=b&s=Your+script+po
> ssibly+relies+on+a+session+side-effect ).

Interesting... I read through them, but I don't think I'm doing what they
fingered as the most likely cause;  that is, using the old style
session_register and related functions rather than the newer $_SESSION
array. I did a batch find through my admin directory for anything containing
the string "session_" and the only results that came up were the
session_start() at the head of each page, and session_destroy() on the few
that needed to clear the current session. Both of those are still correct in
the current version of PHP, right? Or am I mixed up?


Lynna


--
Resource Centre Database Coordinator
Gallery 44: www.gallery44.org
Database Project: www.gallery44db.org