<?php
session_start();
if(isset($_SESSION['student_id'])){
    $student_id = $_SESSION['student_id'];
    if(!isset($_SESSION['email']) && !isset($_SESSION['phone'])){
        $redirect_url = "login/";

        // Perform the redirect
        header("Location: $redirect_url");

        exit;
    }
}else{
    // Unset all session variables
    session_unset();

    // Destroy the session
    session_destroy();
    
    $redirect_url = "login/";

    // Perform the redirect
    header("Location: $redirect_url");

    exit;
}
