summaryrefslogtreecommitdiff
path: root/pages/logout.php
blob: 02632789248ba1778223cac92cfa9877f0b6f1eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php

if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) {
    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'])));
    }
}

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();