<?php
header("Content-Type: application/json");
session_start();

// Destroy the session
$_SESSION = [];
session_unset();
session_destroy();

// Remove the JWT token by setting an expired cookie
setcookie("auth_token", "", time() - 3600, "/", "app.watify.io", true, true); // Secure, HTTP-only cookie

echo json_encode(["status" => "success", "message" => "Logged out successfully"]);
exit();
?>
