diff options
Diffstat (limited to 'pages/logout.php')
-rw-r--r-- | pages/logout.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/pages/logout.php b/pages/logout.php index ea1bfce..0263278 100644 --- a/pages/logout.php +++ b/pages/logout.php @@ -1,16 +1,15 @@ <?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 +} + +if (isset($_COOKIE['PEH2_USER_TOKEN'])) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens-public/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_USER_TOKEN'])))) { + unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens-public/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_USER_TOKEN']))); + } +} + +header("Location: /") and die();
\ No newline at end of file |