I am trying to connect cake php with Facebook PHP SDK
In App_Controller beforeFilter function
$facebook = new Facebook(array(
'appId' => Configure::read("FB_APP_ID"),
'secret' => Configure::read("FB_APP_SECRET"),
));
// Get User ID
$user = $facebook->getUser();
pr($user);
$logoutUrl = $facebook->getLogoutUrl();
$loginUrl = $facebook->getLoginUrl();
$this->set(compact('logoutUrl'));
In view.ctp
<a href="<?php echo $logoutUrl; ?>">Logout</a>
Here i already sign in application with facebook, but when i try to logout using logoutUrl, I always get user id of user who was login before I clicked the logout .
$user = $facebook->getUser();
// always get the user id.
pr($user);
Why this happens, whether logout url is not working ?