如何注销从facebook和谷歌在hybridauth在php


How to logout from facebook and google in hybridauth in php

我在我的网站上使用hybridAuth进行社交登录(facebook,google)。它工作得很好,但是当一个用户从我的网站注销时,它只会将他从我的网站注销,而用户仍然登录facebook或google,无论他以前登录过什么。

我的代码

<?php
    session_start();
    include('config.php');
    include('hybridauth/Hybrid/Auth.php');
    if($_SESSION['role'] == 'retailer')
    {
        $url = 'http://mysiteurl.net/demo/index.php';
    } 
    else
    {
        $url = 'http://mysiteurl.net/demo/admin_index.php';
    }
    $hybridauth = new Hybrid_Auth();
    $hybridauth->logoutAllProviders();
    $_SESSION = array();
    session_destroy();
    header("Location: $url");
    ?>

我试过这个,但它不适合我。请帮帮我。

会话存在于该人的登录网络中,该人需要从他们的。

如果你想要断开连接/数据之间的登录网络和你的网站,你可以使用以下功能,但这将只工作后的人从该网络注销。

public function logout(){
$this->load->library('HybridAuthLib');
$service = $this->hybridauthlib->logoutAllProviders();
}