Wednesday, 11 September 2013

facebook login not working when cancel the permitions

facebook login not working when cancel the permitions

I have used this code for facebook logout, it working fine when user
allows all permissions.Its not working when user cancel all permissions
and click logout at that time user redirect to facebook page.
<?php
require 'fconfig.php';
require 'src/facebook.php';
$facebook = new Facebook(array(
'appId' => $appID,
'secret' => $appSecret,
));
$logoutUrl = $facebook->getLogoutUrl(array(
'next'=>siteURL.'/index.php?cod='.$_SESSION['merchant_code']
));
session_destroy();
$facebook->destroySession();
header('location:'.$logoutUrl);
?>

No comments:

Post a Comment