Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unknown session error - a bug ?

Status
Not open for further replies.

DaSe

Programmer
Feb 14, 2008
149
0
0
GB
Hi guys,
That's quite confusing - I use one of the latest PHP editions and DON'T use session_register() as it's a deprecated function. My register_globals are OFF. My session assigments incode are as follows:
Code:
while($row=mysql_fetch_array($select)) {
extract($row);



 $id = $row["id"];   
     
       $_SESSION['id'] = $id;
       
	    $firstname = $row["firstname"];  
	
       $_SESSION['firstname'] = $firstname;
       
	    $email1 = $row["email"];   
     
        $_SESSION['email'] = $email1;
		
         
mysql_query("UPDATE `mymembers` SET last_log_date=now() WHERE id='$id'"); 


$pass=$password;
$first=$firstname;
$email1=$email;

}

The problems is that after the login I get the error "Uknown : your script relies on session_side effect....." and also when $_session['firstname']; doesn't echo / prints - but apart of these things the script seems to be working. Why it gives me this error while I don't use any deprecations and why it doesn't print $firstname ? Thank you fr all the comments !
 
you must turn sessions on each script.

Code:
session_start();

the $_SESSION superglobal is available only after session_start() is called.
 
Hi , yes , I had done it just didn't put it in this code - it prints $_session fine now in every page and the session itself doesn't make any problems. The only problem is this error. I guess it wouldn't appear on the hosting server - for the time being I have my site set up locally. Anyway, there's no point to modify session.bug or warning - they're to inform that sth. is wrong anyway. Strange thing is that I don't use session_registers at all. Regards.
 
it sounds like there is an over zealous parsing going on that is triggering the warning.

change your php.ini to turn OFF the session.bug_compat_warn directive.

make sure that register_globals is OFF of course.

and don't forget to restart the webserver after making a change to php.ini
 
Thanks - I'll try to set the session.bug to off.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top