Session variables do not seem to work for me. I do not know what I am doing wrong. This is the code I use to verify a valid password:
if ($input_password_hash == $password_hash)
{
session_start();
$_SESSION['is_user'] = 1;
header("Location: ../new_look");
}
else echo "Wrong password.";
in the index.php file (where it is redirected), I have this code:
if ($_SESSION['is_user'] == 1)
{
//show index page with navigation bar for registered user
}
else
{
//do something else
}
but it doesn’t work at all.
The session obviously begins, and this can be verified by checking the cookie.
What am I doing wrong?
source
share