0

I've been banging my head against a wall with this one for way too long now.

I have a page outside facebook, with a like-button. Because it should be on a public computer, we also need a visible logout-button. When "like" is clicked, the user is prompted for login credentials. If those are ok, the like-event goes through ok. The user then should be able to log out. Which doesn't work.

The like button is now an -element. When clicked, it creates an edge.create-event that I can catch nicely.

For Logout button, i've tried 2 options.

First one:

<fb:login-button autologoutlink="true"></fb:login-button>

problem with this is, the link stays as "login" even after the user has logged in through the like-link, even after page refresh.

and a plain button, that triggers

FB.logout(function(response) {
   cout(response);
});

This returns an error "FB.logout() called without a session." this seems to be because the user hasn't authorized the application. So the application has no rights. Both logout-options work fine IF the user has authorized the application. Problem is, this is only asked when the "login"-button is clicked. In this use case it wouldn't make sense for the user to first login and then click like.

Any ideas how to get the logout to work without getting the app authorization from the user? Or how to make "like"-button in a way that it will ask for the app authorization?

4

1 に答える 1

0

私はそれが可能だとは思わない。

誰かが現在 Facebook にログインしているかどうかを確認できますが、あなたがログインしていないかどうかを確認できます。ユーザーがアプリを承認されていない場合、ログイン セッション (またはデータ) を使用して何もできません。

公共のコンピューターについて心配する必要はないと思いますが、これは Facebook の問題であって、あなたの問題ではありません。ユーザーがログイン中に公共のコンピューターで「remember me」をチェックすると、ログアウト ボタンもクリックしない可能性が高くなります。

于 2010-09-27T16:11:27.070 に答える