0, 'path' => '/', 'secure' => true, 'httponly' => true, 'samesite' => 'None', ]); } if (session_status() === PHP_SESSION_NONE) { session_start(); } if (!isset($_SESSION['user_id'])) { http_response_code(403); echo "Unauthorized"; exit; } $id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT); if (!$id) { echo ''; exit; } // Fetch session details $stmt = db()->prepare("SELECT s.*, r.name as register_name, u.username FROM register_sessions s LEFT JOIN cash_registers r ON s.register_id = r.id LEFT JOIN users u ON s.user_id = u.id WHERE s.id = ?"); $stmt->execute([$id]); $s = $stmt->fetch(); if (!$s) { echo ''; exit; } ?>