How to create simple Member Login for your websites. Part 3 - Logging Out Users

Part 3 - Logging out users
<?php
session_start();
// if the user is logged in, unset the session
if (isset($_SESSION['admin_loggedin'])) {
unset($_SESSION['admin_loggedin']);
}
// now that the user is logged out,
// go to login page
header('Location: index.php');
?>
All we do to logout the user is again start the session then we check to see if the user is logged in and if they are unset the session and redirect them back to the login page (index.php).
Part 2 - Managing Sessions
Back to the start
Comments
Comments will be displayed here
Contact Me
If you would like to contact me, the easiest and quickest way to do so is by filling out the contact form on this website.
If you prefer you can contact me on any of these Websites:







