Hi,
I have the code below, which used to work fine, however I have just changed hosts and now I am getting 2 errors:
<?php
if (isset($_SESSION['admin'])) {
header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "index.php");
ob_end_clean();
exit();
} else {
/* If user is logged in */
$_SESSION = array();
session_destroy();
setcookie (session_name(), '', time()-300, '/', '', 0);
}
?>
Errors:
Warning: session_destroy() [function.session-destroy]: Trying to destroy uninitialized session in /home/prioryfi/public_html/logout.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /home/prioryfi/public_html/logout.php:11) in /home/prioryfi/public_html/logout.php on line 12
Appreciate any help