【问题标题】:How to logout from facebook and google in hybridauth in php如何在php中的hybridauth中从facebook和google注销
【发布时间】:2015-09-17 12:28:37
【问题描述】:

我在我的网站中使用 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");
    ?>

我试过这个,但它不适合我。请帮帮我。提前致谢。

【问题讨论】:

    标签: php facebook hybridauth


    【解决方案1】:

    该人登录的网络中存在会话,该人需要从其注销。

    如果您想断开登录网络和您的站点之间的连接/数据,您可以使用以下功能,但这仅在用户从该网络注销后才有效。

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

    【讨论】:

      猜你喜欢
      • 2015-03-11
      • 2019-03-03
      • 2018-08-26
      • 1970-01-01
      • 2013-03-25
      • 2012-04-03
      • 1970-01-01
      • 2012-09-11
      • 2010-11-26
      相关资源
      最近更新 更多