phpbb3和facebook登出代码

That is my page:

<?php

define('IN_PHPBB', true);
global $phpbb_root_path;
global $phpEx;
global $user;
global $auth;

$phpEx = 'php';
$phpbb_root_path = '../forum/';

require($phpbb_root_path . "common.php");
$user->session_begin();

$user->session_kill(true);
$user->session_begin();

require 'src/facebook.php';
$facebook = new Facebook(array(
'appId' => 'x',
'secret' => 'x',
'cookie' => true,
));
$user = $facebook->getUser();
if ($user) {
try {
    echo $facebook->api('/me/permissions', 'delete');
} catch (FacebookApiException $e) {
    error_log($e);
    $user = null;
}
}

unset($_COOKIE['test']);
setcookie('test', null, -1, '/');

header("Location: ../index.php");

When I commented out phpbb3 logout code page load fast, but when code is run page load slow?I searched for a method but have not found the solution to my problem. If you can give any advice I would be grateful. The delay is such that, for example, the page opens with a 10 second delay, not immediately. Sorry, for my bad English :(.

sorry i can't write comment try this

setcookie("test", "", time()-3600,'/');
//-----------------------here time() -value not just -value may help U