I am using Facebook SDK v5. Here i am after login, i can get user's data but after that i try to logout user from my web application as well as Facebook that is not working.
Here is my code.
$a = $this->helper->getLogoutUrl($this->session>userdata('facebook_access_token'),site_url());
$user_data = $this->session->all_userdata();
foreach ($user_data as $key => $value) {
if ($key != 'session_id' && $key != 'ip_address' && $key != 'user_agent' && $key != 'last_activity') {
$this->session->unset_userdata($key);
}
}
$this->session->sess_destroy();
header("Location:" . $a);
here $a
return url.
like this https://www.facebook.com/logout.php?next=[redirect_uri]&access_token[access_token]
but Session destroy in my application so user logout in my application but not logout from Facebook.