Solution for facebook logouturl not working
we can get the user information,facebook loginUrl and logoutUrl from the below code using facebook SDK. but now the logoutUrl is not working in facebook by using below code
$config = array(
'appId' => '1234',
'secret' => '123456789','fileUpload' => true, // Indicates if the CURL based @ syntax for file uploads is enabled. $user_id = $facebook->getUser();
// We may or may not have this data based on whether the user is logged in.
//
// If we have a $user id here, it means we know the user is logged into
// Facebook, but we don't know if the access token is valid. An access
// token is invalid if the user logged out of Facebook.$profile = null;
if($user_id)
{
$userInfos = $facebook->api('/'.$user);
try {
// Proceed knowing you have a logged in user who's authenticated.
$profile = $facebook->api('/me?fields=id,name,link,email');
$fql = "select name, location, sex, pic_square from user where uid=" . $user;
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fb_data = array(
'me' => $profile,
'uid' => $user_id,
'loginUrl' => $facebook->getLoginUrl(),
'logoutUrl' => $facebook->getLogoutUrl(),
);
<del></del>print_r($fb_data);
The above fetch logourUrl is not working
if try below code ie to find facebook logoutUrl separate. its a valid logoutUrl its working for me
function get_logout_url(){//return the facebook logoutUrl
return $facebook->getLogoutUrl();
}
I see you use array scope in getLogoutUrl. I think this only is for use with getLogin do you know because is that?=
ReplyDeleteyes no need of array scope in logouturl(). thank u
DeleteIn codeigniter, I have fixed it.
ReplyDeleteThe cookie name is PHPSESSID
http://ashish-thakur.blogspot.in/2012/07/facebook-php-sdk-logout-resolved.html
tanks for share
ReplyDeleteAdded the session_destroy() in getLogoutUrl function.
ReplyDelete