I know there are so many posts about issues like this, but I can not find solution for myself.
In SimpleMachines forum (SMF) I integrated Login via Facebook, and it works fine.
On the other side, I can not force system to log me out from Facebook together with SMF logout action.
I tried, to:
- $facebook->destroySession();
- redirect end user to https://www.facebook.com/logout.php?... with appropriate params
- tried also to use setcookie('fbs_'.$facebook->getAppId(),
... etc, but still end user is logged into Facebook.
Can you please give me some advice hot to do that?
UPDATE: Here is how my code looks now, after changes suggested by CBroe:
require_once("facebook.php");
$config = array();
$config['appId'] = '1XXXXXXXXXXXX50';
$config['secret'] = '6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX2';
$config['fileUpload'] = false;
$facebook = new Facebook($config);
$user = $facebook->getUser();
$logoutUrl = $facebook->getLogoutUrl();
//session_destroy();
$facebook->destroySession();
header('location:https://www.facebook.com/logout.php?access_token='.$config['appId'].'&confirm=1&next=www.mydomain.com');