开发者

Logout from FB application - PHP SDK - problem with URL parameters

开发者 https://www.devze.com 2023-03-21 07:20 出处:网络
I\'m using in the function getLogoutUr开发者_Go百科l() in order to enable to the user to log out.

I'm using in the function getLogoutUr开发者_Go百科l() in order to enable to the user to log out.

When the user is on url page with parameters there is a problem. If the user will press on logout link which directs to A.php page which is including header command. The header url is (example):

https://www.facebook.com/logout.php?next=http://bla.net?x=100&y=200&z=120

it will redirect to:

http://bla.net?x=100

and not to the full URL.

I've tried to use in urlencode on http://bla.net?x=100&y=200&z=120 but it didn't help. It's redirecting to Facebook home page.

I'd like to get any help. Thanks in advance.


That was a known bug in the old PHP SDK , as far as I remember. If you have not switched to the new PHP SDK, I would recommend doing that. But as a workaround for your current problem - use the JavaScript SDK to logout ( either thru AJAX or just echoing out the js snippet from your PHP code). Redirect to your desired URL in it's callback function:

FB.logout(function(response) {
  window.location="redirect URL";
});

Hope that helps.

0

精彩评论

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