I am having an issue with this as once an individual is logged in it will not logout, even when clicking the Logout link.
Here is my code for the logout:
$page_title = 'Logout';
include_once ('includes/header.html');
// If no first_name variable exists, redirect the user.
if (!isset($_SESSION['member'])) {
header ("Location: index.php");
ob_end_clean(); // Delete the buffer.
exit(); // Quit the script.
} else { // Logout the user.
$_SESSION = array(); // Destroy the variables.
session_destroy(); // Destroy the session itself.
setcookie (session_name(), '', time()-300, '/', '', 0); // Destroy the cookie.
}
// Print a customized message.
echo "You are now logged out.";
include ('includes/footer.html'); // Include the HTML footer.