I am trying to make the user get redirected to the index.html page in case the $_SESSION['loggedin'] is already set. For some reason, it doesn't redirect the user, although the $_SESSION['loggedin'] when echoed returns a value.
if(!empty($_SESSION['loggedin'])) { header('Location: index.html');};
What am I doing wrong here?
session_start()isn't missing and$_SESSION['loggedin']has a value, that does not return false when checked with empty()?