if (isset($_GET['logout'])) {
// session_destroy();
$account_type = $_SESSION['account_type'];
//session_write_close();
unset($_SESSION['success']);
unset($account_type);
header("location: login.php");
}
There are 2 account types: Student and Teacher.
If you make an account as a Student and logout, then register as a Teacher and logout, and then you try to log in to your student account, it'll treat you as a teacher since that's what you last registered as.
This behavior happens vice versa.
Is there a certain session command I should use on logout? Or anything else I could try?