March 27, 201214 yr <?php session_start(); include ("connection.php"); if ($_SESSION['banned'] == 1) die ("Your Account Has Been Disabled, Please Contact An Administrator!"); ?> Can someone modfi this from using sessions to something more better, when i ban a user they wont be banned untill they login again so the session can be set, Need something that will say if theres 1 = in the database (1 means your banned) for that user then kill the script, Next time they refresh the page, It be alot easier and better, or something that can destroy the sessions if it == 1 so they have to login again to apply the sessions.
March 27, 201214 yr <?php session_start(); include ("connection.php"); if ($_SESSION['banned'] == 1) die ("Your Account Has Been Disabled, Please Contact An Administrator!"); ?> Can someone modfi this from using sessions to something more better, when i ban a user they wont be banned untill they login again so the session can be set, Need something that will say if theres 1 = in the database (1 means your banned) for that user then kill the script, Next time they refresh the page, It be alot easier and better, or something that can destroy the sessions if it == 1 so they have to login again to apply the sessions. um why would u even consider using sessions for banning someone the moment the browser is closed the session is distroyed
March 27, 201214 yr You could still use sessions. For my login system, I tend to set user related session info straight from my database, as soon as the user logs in. You could have a field in your database with 'banned', 'user_level' etc. And as soon as the password/username has been verified, retrieve those values and store them in their respectable session indexes. Then do a check if($_SESSION['banned'] == 0) { //whatever you want to do with them here } I don't have to worry about users being able to modify session info as mine session data is all encrypted. Edited March 27, 201214 yr by Samus
March 31, 201214 yr You could still use sessions. For my login system, I tend to set user related session info straight from my database, as soon as the user logs in. You could have a field in your database with 'banned', 'user_level' etc. And as soon as the password/username has been verified, retrieve those values and store them in their respectable session indexes. Then do a check if($_SESSION['banned'] == 0) { //whatever you want to do with them here } I don't have to worry about users being able to modify session info as mine session data is all encrypted. um ur missing the point i think its better practice to have a field in the database that says banned, then check if that isset to 1 for banned user or 0 for non banned user like rallport said sessions are temporary
Create an account or sign in to comment