Active
Project:
Facebook Connect
Version:
7.x-2.0-beta4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2013 at 07:14 UTC
Updated:
4 Jul 2013 at 05:23 UTC
Hi Friends,
I need to write a custom fb connect logout link , so i have write a hook_menu function . at the time of logout its redirecting to facebook , its not clearing facebook session .
when i check the url access token is showing as 0.
function custom_alter_menu() {
$items['custom/login'] = array(
'page callback' => 'custom_alter_facebook_login',
'title' => 'Example Page',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
$items['custom/logout'] = array(
'page callback' => 'custom_alter_facebook_logout',
'title' => 'Example Page',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
function custom_alter_facebook_logout() {
$client = facebook_client();
//print_r($client);
session_destroy();
global $base_url;
$url = $client->getLogoutUrl(array('next' => $base_url));
echo '<script>location.href="'.$url.'";</script>';
//drupal_goto($url);
// print $url;
// die();
}Any please go through the above function . thx
Comments
Comment #1
nyleve101 commentedHi,
I'm also experiencing the issue that logging out causes the user to be redirect to the facebook homepage. This bug only happens in auto login/logout mode.
Did you find a solution?
Thanks,
Ev
Comment #2
aruntvla commentedtry the latest code