Thursday, July 5, 2018

Logout from System


This is the most simplest script but the most important script of all. When you login to a system, it is very important to logout from the system to prevent un-authorized access to the system. Logout is a very simple function that it does only destroy created sessions. Without sessions, other users can not login to the system.

logout.php is the page linked with Logout menu. Following the source code for the logout page.







<?php 
    session_start();
    session_unset();
    session_destroy();
    header("Location: index.php");
?>
Share:

0 comments:

Post a Comment