summaryrefslogtreecommitdiff
path: root/pages/api/session.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/api/session.php')
-rw-r--r--pages/api/session.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/pages/api/session.php b/pages/api/session.php
index f91288e..53e1845 100644
--- a/pages/api/session.php
+++ b/pages/api/session.php
@@ -14,11 +14,12 @@ if (!$isLoggedIn || $isLowerLoggedIn) {
], JSON_PRETTY_PRINT));
}
-$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])), true);
+global $token;
+$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)), true);
die(json_encode([
"name" => $data["name"],
"created" => date('c', $data["created"]),
"last_seen" => date('c', $data["last"]),
- "seen_at" => array_keys($data["addresses"])
+ "seen_at" => array_keys($data["addresses"] ?? [])
], JSON_PRETTY_PRINT)); \ No newline at end of file