<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);

require_once 'session_config.php'; // Shared session handling
include("config.php");

// Disable browser caching
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

date_default_timezone_set('Asia/Kolkata');

if (isset($_SESSION['employee_id'])) {
    $employee_id = $_SESSION['employee_id'];

    // Destroy the session after updating
    session_unset();
    session_destroy();
}

// Redirect back to login page
header("Location: index.php");
exit();
?>
