I was trying to build my own secure PHP Sessions Class, when i was actually wondering what's stopping someone from emulating the session?
IE, why wouldn't a code on test.php
$_SESSION['logged_in'] = true;
Not be able to work on index.php where
if($_SESSION['logged_in'] == True){
echo 'logged in';
}
I understand that the way about this is to secure the session by generating a secure ID by locking it to the IP Address and User Agent, but how exactly does that work?
Meaning if i were able to guess the session ID would i be able to set the $_SESSION['logged_in'] = true and emulate the login? Should i then change the SESSION variable to check for login to a more secure one?
Sorry for my questions and hope i make some sense...