session side-effect error OK during troubleshooting?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Twayne
Forum Newbie
Posts: 14
Joined: Fri Jun 20, 2008 11:47 am

session side-effect error OK during troubleshooting?

Post by Twayne »

HI,
New to PHP; not a programming question here; hope this is a good place to post it.

I just had an "interesting" troubleshooting session and was hoping someone could explain what happened. Not positive, but I'd swear I've done this before without any untoward results:

Namely, assigning values to variables to vars already assigned in SESSION variable. In other words for instance, have a " $_SESSION['age2']=$age2;" and " $age=$_SESSION['age'];" under SESSION_Start.

Then to TS I assigned age and age2 specific, fixed variables to I could easily control what was in them. I'm sure it's no surprise to folks here that I received:

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

PHP 5.2.5, BTW. Local with a local Apache server.

Any chance anyone could explain what the message means more specifically, and whether I'm doing anything to PHP that, when I remove the ts'ing assignments (and the error goes away), that will result in problems down the road?
In other words, is my PHP operating normally during that error condition?

Dumb questions I suppose, but the unasked question ...

TIA,

Twayne
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Re: session side-effect error OK during troubleshooting?

Post by tecktalkcm0391 »

Edited: Post your full code, cause it may be something else within it, check for any session_register()'s...

Read http://www.php.net/manual/en/ref.session.php#55239
Post Reply