When user logs in I use the following strategy to authenticate user:
$_SESSION['logged_in'] = true if above returns trueif ($_SESSION['logged_in'] > 0) otherwise redirects to login page.Is it possible that a hacker might somehow set $_SESSION['logged_in'] = true; ? Do I have a security issue with the above strategy?
Please give me an article or anything that can help me make it more secure.
Sessions are stored on the server so it is impossible for a user to modify anything within the session unless he breaks into your server - in that case he could obviously run $_SESSION['logged_in'] = true; or perform anything else circumventing whatever security measures you have in your code.
The only thing stored on the client side is the session ID cookie. This is a random 32-character hash that does not contain any data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With