Log in

View Full Version : member.php (2.3.0).


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.

filburt1
03-25-2003, 02:22 PM
// make sure any other of this user's sessions are deleted (incase they ended up with more than one)
sessions.php is terrifying to look at, anyway.

Davey
03-25-2003, 02:27 PM
So I was right or what?
Was that code adding an extra query or was it genuinely needed to function correctly?

Dave.

N9ne
03-25-2003, 03:37 PM
The first query in that batch of code is for guests, the second, for members.

Xenon
03-25-2003, 04:11 PM
Yes, it's needed.

Without it guestsessions would make problems ;)

Davey
03-26-2003, 10:48 AM
Ohhh I see.
Thanks.

Dave.