<?php
if (session_status() === PHP_SESSION_NONE) {
	session_start();
}
// Unset specific user session keys and destroy session
unset($_SESSION['user_id'], $_SESSION['user_name'], $_SESSION['is_admin']);
$_SESSION = [];
session_destroy();

// Redirect to frontend login page
header('Location: user/login.php');
exit();

