html - User Login with roles not working properly in PHP
one text
Solution:
You need to use OR in this check not AND
<?php
session_start();
if(!isset($_SESSION['loggedIn']) ||
$_SESSION['loggedIn']!='true' ||
$_SESSION['userType']!='User')
{
header("Location: ../login.php");
exit;
}
Source