<?php
$sid = $_GET['sid'] ?? '';
if (!$sid) { die(json_encode(["status" => "error"])); }

$sessionsFile = "sessions.json";
$sessions = file_exists($sessionsFile) ? json_decode(file_get_contents($sessionsFile), true) : [];

if (isset($sessions[$sid])) {
    echo json_encode(["status" => $sessions[$sid]['status']]);
} else {
    echo json_encode(["status" => "error"]);
}

