-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogout.php
More file actions
33 lines (23 loc) · 708 Bytes
/
logout.php
File metadata and controls
33 lines (23 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php # logout.php - Script 9.14
// This page logs the user out.
// Need the utilities file:
require('includes/utilities.inc.php');
// Check for a user before attempting to actually log them out:
if ($user) {
// Clear the variable:
$user = null;
// Clear the session data:
$_SESSION = array();
// Clear the cookie:
setcookie(session_name(), false, time()-3600);
// Destroy the session data:
session_destroy();
} // End of $user IF.
// Set the page title and include the header:
$pageTitle = 'Logout';
include('includes/header.inc.php');
// Need the view:
include('views/logout.html');
// Include the footer:
include('includes/footer.inc.php');
?>