<?php
session_start();

/**
 * Ye file "Gatekeeper" ka kaam karti hai.
 * Agar user login nahi hai (session set nahi hai),
 * to ye usey foran login page par bhej degi.
 */

if (!isset($_SESSION['user_name'])) {
    // User login nahi hai, redirect kardo
    header("Location: login.php");
    exit();
}

/** 
 * Session Persistence:
 * Jab tak user khud logout nahi karega ya browser ki settings 
 * clear nahi hongi, uska session active rahega.
 */
?>