note 25615 rejected from function.session-destroy by victor

From: Date: Mon, 30 Sep 2002 20:52:07 +0000
Subject: note 25615 rejected from function.session-destroy by victor
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-37436@lists.php.net to get a copy of this message
I have a problem registering unique session id's. I check my database to see if it exists already and if it does then create another session id but for some reason it stays the same as the one that already exists in the database that has just been used. Please help... <? /* * My source */ session_start(); $_SESSION['userInfo']['sess_id']=$PHPSESSID; $mysql=new mysql($host, $user, $password, $db, 0); // Starting up my connection using my class $mysql->query("SELECT * FROM $tblRegistrations WHERE session_id='" . $_SESSION['userInfo']['sess_id'] . "'"); // Checking just to make sure that session doesn't exist already in the database if($mysql->num_rows() > 0){ // If it does, then do this... unset($_SESSION); // Unset $_SESSION=array(); // Reset? $_SESSION['userInfo']['sess_id']=md5(uniqid(rand(),1)); // Attempting to register a new one but it keeps the one I just used } ?>

« previous php.notes (#37436) next »