<?php
session_start();
$isLoggedIn = false;

if (!empty($_SESSION['admin_id'])) $isLoggedIn = true;
if (!empty($_SESSION['admin_logged_in']) && $_SESSION['admin_logged_in'] === true) $isLoggedIn = true;

if ($isLoggedIn) {
    header("Location: /admin/dashboard");
    exit;
}

header("Location: /admin/login");
exit;
