<?php
require_once __DIR__ . '/../src/session.php';

// Log logout activity before destroying session
if (isAuthenticated()) {
    $current_business = getCurrentBusiness();
    if ($current_business) {
        logActivity('logout', 'User logged out from business: ' . $current_business['business_name']);
    }
}

// Destroy session using our session management system
destroySession();
header("Location: login.php");
exit;
?>
