-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogout.php
More file actions
35 lines (31 loc) · 750 Bytes
/
Copy pathlogout.php
File metadata and controls
35 lines (31 loc) · 750 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
34
35
<?php
session_start();
require 'inc/checker.php';
require 'inc/config.php';
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $appname; ?> - Logging Out</title>
<?php include 'inc/styles.php'; ?>
</head>
<body class="mainbody">
<main>
<?php
if(isset($_COOKIE['clogin']) && $_SESSION['clogin']==true && $_SESSION['cuserid']){
// If user is already actually signed in.
setcookie('clogin','[]',time()-84600*15); // Remove the cookie.
$_SESSION['clogin'] = false;
$_SESSION['cuserid'] = 0;
echo "<br><br>Successfully Logged out.<br>";
header("refresh:1.5;url=index.php");
exit();
}else{
echo "<br><br>Already Logged Out.<br><br>";
header("refresh:1.5;url=index.php");
exit();
}
?>
</main>
</body>
</html>