<?php
/**
 * ============================================================
 * AJAX: User Logout
 * ============================================================
 */

// Initialize
define('BASE_PATH', dirname(dirname(dirname(__DIR__))));
require_once BASE_PATH . '/app/config/config.php';

// Start session
if (session_status() === PHP_SESSION_NONE) {
    session_name(SESSION_NAME);
    session_start();
}

// Clear user session data
unset($_SESSION['user_id']);
unset($_SESSION['user_name']);
unset($_SESSION['user_email']);
unset($_SESSION['last_activity']);
unset($_SESSION['applied_promo']);

// Regenerate session ID for security
session_regenerate_id(true);

Response::success('সফলভাবে লগআউট হয়েছে');
