<?php
/**
 * 芋头CMS - 会员退出
 */
error_reporting(0);
ini_set('display_errors', 0);

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
$_SESSION = [];
$cookies = ini_get('session.use_cookies') ? true : false;
if ($cookies) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 3600,
        $params['path'] ?? '/',
        $params['domain'] ?? '',
        $params['secure'] ?? false,
        $params['httponly'] ?? false
    );
}
session_destroy();
header('Location: /member/login.php', true, 302);
exit;