开发者

facebook connect does not clear session cookie on logout

I'm doing some integration with Facebook on a project (using graph api) and everything was working fine until now I discovered that facebook doesn't clear my session when I click on the logout url. I'm doing logout through php, not javascript, so the logout url looks like:

https://www.facebook.com/logout.php?next=url&access_token=token

After clicking on that link the user is logged out on facebook, but the session still exists on my website. To actually clear the session I have to refresh the page one more time after clicking that url. This is a strange behavior, in my opinion.

What you guys think of this? I tried even to personally remove the facebook cookie, but it is still there, and it is cleared only after I hit the refresh button on my browser.

p.s. to get the facebook session I do something like this:

My_Facebook_Helper::instance()->getSession(); //it should be === null if it doesn't exist

p.p.s. it could be a bug? i don't rem开发者_Python百科ember having this issue about a week ago when I first started to implement this


I ran into this bug and realized it wasn't that the session wasn't being cleared, but if you have offline access, it will automatically get you a new session.


Try finding the formatData function somewhere at LoginWindow (AS3) and find this line:

vars.redirect_uri = FacebookURLDefaults.LOGIN_SUCCESS_URL

Change the value for 'http://www.facebook.com/' and logout from that html page when logged in.

This is a temporary solution to logout if you are developer, not the end user.


This is registered as a bug. Please add your own repro to this bug to help get it fixed

http://developers.facebook.com/bugs/250825644953332


I have just a solved a simular problem today. Try using this to get your session:

$session = $facebook->getSession();

And this could also help for the logout url:

$logoutUrl = $facebook->getLogoutUrl(array('next' => $url, 'session_key' => $session['session_key']));

Hope it helps!


I tried this

$logoutUrl = $facebook->getLogoutUrl(array('next' => 'some url', 'session_key' => $session_key)) . 'session_key=null';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜