21 lines
418 B
PHP
21 lines
418 B
PHP
<?php
|
|
// auth/logout.php
|
|
session_start();
|
|
require_once '../config/db.php';
|
|
require_once '../includes/functions.php';
|
|
|
|
if (isset($_SESSION['cid'])) {
|
|
add_log($pdo_sys, $_SESSION['cid'], $_SESSION['fullname'], 'Logout', 'User logged out');
|
|
}
|
|
|
|
// Unset all of the session variables
|
|
$_SESSION = array();
|
|
|
|
// Destroy the session.
|
|
session_destroy();
|
|
|
|
// Redirect to login page
|
|
header("location: ../index.php");
|
|
exit;
|
|
?>
|