I have a website which has a session system. In the main page i have a logout button which calls a logout.php file. The file contains:
<?PHP
unset($_SESSION['user_id']);
unset($_SESSION['user_name']);
unset($_SESSION['user_admin']);
unset($_SESSION['user_coins']);
unset($_SESSION['user_email']);
unset($_SESSION['user_createtime']);
header("Location: index.php");
?>
The file runs like it should, it ends the session but it doesn't do the redirect. It just ends the session and stops there. What can be the problem?