Jump to content

[SOLVED] Sessions


mcmuney

Recommended Posts

The other day, I found a user of my site mass spamming. While he was sending messages to other users of the site, I deleted his account. The strange thing is that he was able to continue to send messages even though his account was deleted. I'm assuming this was the case because he was already signed on and it has something to do with sessions. But once he signed off, the account would not be usable.

 

Is there any way to code it so that when an account is removed from the DB and the user is still signed on, it automatically disables the account?

Link to comment
https://forums.phpfreaks.com/topic/168011-solved-sessions/
Share on other sites

you must have some type of "authorization" script included in all member areas, right? to see if the user is signed on or not... you could, instead of just checking if the session set, also have a db query checking to see if there account is enabled.

 

or when you disable the account you could actually manually delete their session data file located on the server...

Link to comment
https://forums.phpfreaks.com/topic/168011-solved-sessions/#findComment-886132
Share on other sites

This is what I'm using now:

 

<?session_start();
extract($_POST);
extract($_GET);
extract($_SESSION);
if(trim($mem_id)=="")
{
header("Location: ./login.php");
die();
}
?>

 

Can I use an if/OR statement, like (please check the syntax):

 

if((trim($mem_id)=="") OR if EXISTS(SELECT * FROM Table1 WHERE member_id='$mem_id')

//this should be DOESN'T EXIST

Link to comment
https://forums.phpfreaks.com/topic/168011-solved-sessions/#findComment-886141
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.