我在 page.php 上有一个用作链接的注销按钮,单击时会将用户定向到 logout_facebook.php。问题是永远不会发生注销,而只是将用户引导到 Facebook 主页。我该如何解决?
示例代码
<?php
require_once('engine/facebook/facebook.php');
//Application Configurations (Facebook)
$app_id ="XXXXXX";
$app_secret="XXXXXXX";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$logoutUrl = $facebook->getLogoutUrl(array( 'next' => ($fbconfig['baseurl'].'logout.php') ));
//on logout page
setcookie('fbs_'.$facebook->getAppId(), '', time()-100, '/', '.mydomain.com');
session_destroy();
header('Location:'.$logoutUrl);
/*$facebook->destroySession();
header('Location: http://mydomain.com/index.php?lo=facebook&ad=1');*/
?>