diff options
Diffstat (limited to 'pages/logout.php')
-rw-r--r-- | pages/logout.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pages/logout.php b/pages/logout.php new file mode 100644 index 0000000..ea1bfce --- /dev/null +++ b/pages/logout.php @@ -0,0 +1,16 @@ +<?php + +if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) { + if (str_contains($_COOKIE['PEH2_SESSION_TOKEN'], ".") || str_contains($_COOKIE['PEH2_SESSION_TOKEN'], "/")) { + header("Location: /") and die(); + } + + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) { + unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN']))); + header("Location: /") and die(); + } else { + header("Location: /") and die(); + } +} else { + header("Location: /") and die(); +}
\ No newline at end of file |