1

facebook, as usual does not work as expected.

on calling

$facebook->getLogoutUrl($params);

using

 $params = array( 'next' => 'http://mywebsiteurl.com/loggedout.php' );

The browser view is redirected to loggedout.php, which is good. Except when the user proceeds to facebook.com they find they are still logged in, which is not good.

So, where do we go from here? What am i doing wrong? What did facebook do wrong?

Mary Trakker
  • 41
  • 1
  • 5
  • This seems like a better answer http://facebook.stackoverflow.com/questions/7680523/facebook-getlogouturl-link-doesnt-log-user-out-of-facebook – MauricioOtta Feb 15 '13 at 09:46

3 Answers3

1

it's because of the cookie. I did the following to fix this issue ...

in the params for the getLogoutUrl method you set your own logout URL:

$facebook->getLogoutUrl(array( 'next' => 'http://www.yourdomain.com/logOut/' ));

and in your logout file you reset the cookie:

setcookie('PHPSESSID', '', time()-3600, '/');
header('Location: http://www.yourdomain.com');
0

I have the same issue. After returning from the logout URL, calling $facebook->getUser() still returns the user's id.

I got around this by adding a query string to the 'next' parameter, which if set, I treat the user as if they were logged out.

0

I've had similar issues with the SDK, where using the getLogoutUrl(); with a next parameter does not ever get redirected back to the web-application.

So, I've given up on getting the users to be able to use that functionality to dis-connect my application. Now I just delete their access tokens from our system and tell them to manually de-authorise the application on the FB site - and provide a hyperlink to http://www.facebook.com/settings?tab=applications

edoceo
  • 360
  • 3
  • 7