prepareLogout(null, $hint); $_SESSION = []; $p = session_get_cookie_params(); setcookie(session_name(), '', [ 'expires' => time() - 3600, 'path' => $p['path'], 'domain' => $p['domain'], 'secure' => $p['secure'], 'httponly' => $p['httponly'], 'samesite' => $p['samesite'] !== '' ? $p['samesite'] : 'Lax', ]); session_destroy(); header('Cache-Control: no-store'); header('Location: ' . $logoutUrl, true, 302); exit;