Davey
03-25-2003, 02:11 PM
I know I'm probably wrong (seeing as I'm still learning PHP, etc.), but I saw this code, and it made me wonder.
//$DB_site->query("UPDATE session SET userid=0 WHERE sessionhash='".addslashes($session[sessionhash])."'");
$DB_site->query("DELETE FROM session WHERE sessionhash='".addslashes($session[dbsessionhash])."'");
if ($bbuserinfo[userid] > 0) {
// make sure any other of this user's sessions are deleted (incase they ended up with more than one)
$DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]'");
}
What is the point of: //$DB_site->query("UPDATE session SET userid=0 WHERE sessionhash='".addslashes($session[sessionhash])."'");
$DB_site->query("DELETE FROM session WHERE sessionhash='".addslashes($session[dbsessionhash])."'");
It seems as though the second section is deleting the users sessionhash from the username rather than the sessionhash itself.
Surely this is just another unneeded query? Or am I looking at this wrong?
Dave.
//$DB_site->query("UPDATE session SET userid=0 WHERE sessionhash='".addslashes($session[sessionhash])."'");
$DB_site->query("DELETE FROM session WHERE sessionhash='".addslashes($session[dbsessionhash])."'");
if ($bbuserinfo[userid] > 0) {
// make sure any other of this user's sessions are deleted (incase they ended up with more than one)
$DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]'");
}
What is the point of: //$DB_site->query("UPDATE session SET userid=0 WHERE sessionhash='".addslashes($session[sessionhash])."'");
$DB_site->query("DELETE FROM session WHERE sessionhash='".addslashes($session[dbsessionhash])."'");
It seems as though the second section is deleting the users sessionhash from the username rather than the sessionhash itself.
Surely this is just another unneeded query? Or am I looking at this wrong?
Dave.