Facebook PHP SDK - will not logout properly

前端 未结 8 755
滥情空心
滥情空心 2021-02-09 17:21

I\'ve been searching for hours for the solution to this problem but can\'t find one that works for me. When i click \"Logout\" on my site the user information is still visible a

8条回答
  •  生来不讨喜
    2021-02-09 17:32

    To answer directly to your question

    ... I don't know where logout is gotten from or where it is defined?

    When you create your logout url, add additional parameter 'logout'

    $logoutUrl = $facebook->getLogoutUrl(array(
        'next'=>'http://yourdomain.com/facebook-test-search.php?logout=yes'
    ));
    

    Then in your script, you clear session and cookies when isset($_GET['logout'])

提交回复
热议问题