Example,
i have a session that i gave to users that have maching password = stored password, like all simple login system :
if ($pSys->checkPassword($AccountData['password'], $StoredData['password'])) { // Checks Password and Username
$_SESSION['login'] = true;
}
so the question is, is this secure enough?
function loginCheck() // put this on every header page that needs to be loggedin.
{
if ( empty( $_SESSION['login'] ))
{
header( 'location:index.php' );
die();
}
}
is there a diffrence between die() exit() ? second, some say that i should add session_regenerate_id(); ? ( is that an overkill ? ) anyway the real question is said above.
addon*
i have read http://stackoverflow.com/questions/328/php-session-security, but it seems it doesn't match my problem here ( that link is just to general ).
Thanks.
heres the checkPassword()
function checkPassword($password, $storedpassword)
{
if($password == $storedpassword){
return true;
}
}
Adam Ramadhan