Search code examples
yiifacebook-social-pluginsyii-extensionsyii-components

How to implement sign out functionality from social networks in Yii auth


Iam using Yii auth extension for login to my website using social networks like facebook, linkedin, twitter etc. Iam able to sign in to the website using the extension. But my problem is that when I signout from my website the accounts of the corresponding networks is not signing out. How can I implement it correctly ?


Solution

  • using access_token from social network we can logout . for fb logout Iam using the below code
    $url = 'https://www.facebook.com/logout.php?next=' . $returnurl. ' &access_token=' . $token; session_destroy(); header('Location: ' . $url);