<?php
// Session lifetime in seconds (1 day)
$session_lifetime = 86400;

// Set PHP session settings
ini_set('session.gc_maxlifetime', $session_lifetime);
session_set_cookie_params($session_lifetime);

// Start session
session_start();

// Refresh the session cookie on every request
if (isset($_SESSION['employee_id'])) {
    setcookie(session_name(), session_id(), time() + $session_lifetime, "/");
}
?>
