Re: Warning regarding session side-effect : puzzle



trookat wrote:
I have been working with php on and off for a while and I have just come across a warning that i haven't seen before

I am using php5 . the warning in question is
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'm just mucking about with some new login stuff using sessions and it all works just fine i decided to update the password in my sqlite db using



$pass=md5('dude');
$system->sqldb->queryExec("UPDATE users SET username='trookat', user_password='$pass' WHERE username='admin'");

i noticed the warning at the end of html .

i commented the sql line out and still got the warning

I renamed the $pass to $passs and the warning vanished ,

note Globals is turned off . Not once i have used $pass in the other code ,

the only reference i have to a pass is in a session var ( thats going to be renamed anyway)


I am assuming that because i have a session with a 'pass' var ( which is always checked with $_SESSION['pass'] ) and i used $pass as a var its caused this error

what i want to know is why the warning? i am assigning a value to $pass, its not like am trying to do a conditional check on it.

Anyone have answers the why? how do i make sure these warnings don't come up on servers that don't have setting session.bug_compat_42 or session.bug_compat_warn set to off. ( other then errorlevel setting? )


Thanks for you time
- trookat

If you can supply a little more code it may be more helpful, but just off the bat, did you use session_start() at the beginning of the pages where your accessing $_SESSION?

Scotty
.



Relevant Pages

  • "register_globals off" and "session side-effect"
    ... Warning: Unknown(): Your script possibly relies on a session side- ... I should replace all global variables which I care ...
    (comp.lang.php)
  • SESSION error -> Your script possibly relies on a session side-effect which existed until PH
    ... 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, ...
    (comp.lang.php)
  • Sessions
    ... Warning: Unknown(): Your script possibly relies on a session side-effect ... My version of php is version 4.3.4 ...
    (comp.lang.php)
  • Sessions
    ... Warning: Unknown(): Your script possibly relies on a session side-effect ... My version of php is version 4.3.4 ...
    (comp.lang.php)
  • sessions
    ... Warning: Unknown(): Your script possibly relies on a session side-effect ... My version of php is version 4.3.4 ...
    (alt.php)