0

i have created a forum using php/mysql and users login through facebook using php sdk. the login works perfectly. the logout however does not. I have not tried the javascript sdk and it is supposted to work . but i need a solution in PHP.

Here are the two things that i have tried.

//this is signout .php

$logoutURL=$facebook->getLogoutURL(array('next'='http://localhost/php_lessons/forum_facebook/logout_page.php'));

header('Location:'.$logoutURL);

//this is signout.php

$ACCESS_TOKEN=$facebook->getAccessToken(); $REDIRECT='http://localhost/php_lessons/forum_facebook/logout_page.php';

"https://www.facebook.com/logout.php?access_token=ACCESS_TOKEN&confirm=1&next=REDIRECT"

both the solutions take me to facebook/home.php of the user that is trying to logout. (me for test purposes).

3 Answers 3

1

The logout problem is because of a recent Facebook API change – ‘offline_access Permission Removal’.

Disable the ‘Deprecate offline access’ setting from Edit App > Advanced > Migrations tab

You can read more about it at: http://developers.facebook.com/roadmap/offline-access-removal/

1
  • thanks a lot. it works. but i still dont understand what the article says.
    – user1308359
    Apr 13, 2012 at 10:49
1
$past = time() - 3600;
foreach ( $_COOKIE as $key => $value )
{
    setcookie( $key, $value, $past, '/' );
}

you can try this code. It will just destroy all cookies saved from your site. Its working for me..!

0

Use getLogoutUrl without the array.

$facebook->getLogoutUrl();
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.