getConf() . "/tmp/user_sessions/" . $_COOKIE["username"] . ".json"), true); if (!isset($json[$_COOKIE["device_id"]])) { return false; } $device = json_decode($json[$_COOKIE["device_id"]], true); if ($device["session_id"] !== $_COOKIE["session_id"]) { return false; } return true; } public function generateSessionID() { $num = rand(1, 999999); $hash = hash("sha256", $num); return $hash; } }