dscdttg4389 2012-02-04 00:24
浏览 34
已采纳

注销似乎不能使用PHP SDK

Im using the PHP SDK, and after a lot of frustration, I decided to ask the question here.

So here it goes. I made a login button in this website: http://greek-night.co.uk/

All goes well when you login, but when you try to logout, it always takes me to http://facebook.com/home.php

I have tried everything codewise, and here are some of the examples i tried.

first:
$logoutUrl = $facebook->getLogoutUrl();

Second:
 $logoutUrl = $facebook->getLogoutUrl(array('next' => $base_url.'/'));

Third
$logoutparams = array( 'next' => 'http://greek-night.co.uk/' );
$logoutUrl = $facebook->getLogoutUrl($logoutparams);

Am I missing anything? I also tried using the 'Debugger' and got this:

Application ID  
212442552170234 : Greek Night

User ID 
1112176796 : Michael Schinis

Issued  
1328299200 : 12:00 pm Feb 3 2012

Expires 
1328302800 : 1:00 pm Feb 3 2012
Valid   False
Origin  Web
Scopes  friends_likes read_stream
  • 写回答

1条回答 默认 最新

  • dqpc1845 2012-02-04 02:22
    关注

    if this happened, you should include the JS SDK...

    window.fbAsyncInit = function() {
    FB.init({appId: 'YOUR_APP_ID', status: true, cookie: true, xfbml: true, oauth: true,});
    
    FB.Event.subscribe('auth.logout', function(response) {
        window.location.reload();
    });
    
    (function(d){
        var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        d.getElementsByTagName('head')[0].appendChild(js);
    }(document));
    

    always make your page reload after logout from facebook connect

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改