0

アプリケーションで facebook javascriptSDK を使用しています。Facebookからのログインとログアウトに使用しました。正常にログに記録されていますが、Facebook からログアウトできません。私はこの関数を使用しています: baseUrl(); ?>/login/logout" class="menu_link" onclick="fb_logout();">ログアウト

   <script>
FB.init({appId: '061665c433986c406bbeda1b465350c1', status: true,
    cookie: true, xfbml: true});

function fb_login()
{
    FB.login(function(response)
        {
            if(response.session!=null)
            {
                window.location.href="http://www.allindiaarchitects.com/registration/index";
            }
        },{perms:'email,user_birthday,offline_access,publish_stream,read_friendlists'});
}


function fb_logout()
{
    FB.logout(function(response) 
    {
        if(response.session!=null)
        {
            //window.location.href="<?php echo $this->baseUrl(); ?>/login/logout";

        }
    });

}
</script>

何をすべきか。どんな体でも助けてくれますか?

4

2 に答える 2

0

問題は、FB.logout メソッドがユーザーをアプリからのみログアウトし、Facebook からもログアウトしないことです...

于 2011-11-14T17:35:58.670 に答える
0

If you're redirecting the user to a separate page subsequent to the logout of FB you should put that redirect only within the callback function that can be passed to FB.logout as a parameter, like this:

<a href="#" onclick="mysignout(url);">logout</a>

Then redirect only from within the callback function of FB.logout

function mysignout(url)

{
    FB.logout(function()
    {
        top.location.href = 'url'
    });
}

FB.logout appears to make an ajax call to revoke authentication on the server and can take several seconds to complete successfully. If you redirect within the anchor link then FB.logout will not have completed successfully before the redirect in some browsers. In particular, this will happen with IE.

See this post: FB.logout not working in IE8

于 2011-08-26T15:04:18.003 に答える