getConf(); $json = json_decode(file_get_contents($config["PATH"] . "/tmp/user_sessions/" . $_COOKIE["username"] . ".json"), true); if (!isset($json[$_COOKIE["device_id"]])) { echo "Device ID gibt es nicht im JSON"; return false; } $device = json_decode($json[$_COOKIE["device_id"]], true); if ($device["session_id"] !== $_COOKIE["session_id"]) { echo "Session IDs stimmen nicht überein"; return false; } return true; } public function generateSessionID() { $num = rand(1, 999999); $hash = hash("sha256", $num); return $hash; } }