我的网站上有一个facebook登录按钮,它有两个问题:
这是我的退出页面代码:
<?php
if (isset($_SESSION['logged_in']))
{
$facebook = new Facebook(array(
'appId' => 'xxxxxxxxxx',
'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
'cookie' => true,
));
//access token is important for logging out from facebook DO NOT REMOVE IT
$params = array( 'next' => 'http://www.example.com/','access_token'=>$facebook->getAccessToken() );
$logoutlink = $facebook->getLogoutUrl($params); // $params is optional.
//ovewrites the cookie
$facebook->destroySession();
session_destroy();
header('Location: '.$logoutlink);
}
?>