I want to check whether the user session is set or not if the session is not set it redirects the user to the login page if the session is set it redirects the user to the view.php page but when I run this code it gives me this error "page isn't working localhost redirected you too many times."
$uid=$_SESSION['uid'];
if (isset($_SESSION['uid'])==false || isset($_SESSION['uid'])==$uid)
{
if (isset($_SESSION['uid'])==false)
{
header("Location:login.php");
}
if (isset($_SESSION['uid'])==$uid)
{
header("Location:view.php");
}
}