<?php
// Start the session
session_start();
if (isset($_SESSION['email']) && isset($_SESSION['admin_id']) && isset($_SESSION['user_id'])) {
    $admin_id = $_SESSION['admin_id'];
    $user_id = $_SESSION['user_id'];
}

if (isset($_SESSION['first_opened_url'])) {
    $firstUrl = $_SESSION['first_opened_url'];
    echo "First opened page: $firstUrl";
 
    // Or redirect back
    header("Location: $firstUrl");
    exit;
}
?>
