session side-effect error OK during troubleshooting?
Posted: Sat Jun 28, 2008 1:18 pm
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
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