簡體   English   中英

如何在PHP的HybridAuth中從Facebook和Google注銷

[英]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();
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM