36637-vm/logout.php
2025-12-04 03:23:32 +00:00

16 lines
324 B
PHP

<?php
session_start();
// Unset all of the session variables
$_SESSION = [];
// Destroy the session.
if (session_destroy()) {
// Redirect to login page
header("Location: login.php");
exit;
} else {
// Handle error, though session_destroy() rarely fails
echo "Error: No se pudo cerrar la sesión.";
}
?>