After I click on my logout button, it redirects me to:
https://www.facebook.com/home.php. Why is it that when I return to my app domain, I can still see the logout button…?
Here is my code:
<?php
//User login/logout buttons
if($user) {
echo '<a href="'.$facebook->getLogoutUrl(array('next' => 'myurl.com/facebook/')).'"><img src="src/logout-fb.png" alt="Facebook Logout Button" /></a>';
}else{
$params = array(
scope => 'user_photos, publish_stream',
redirect_uri => 'http://myurl.com/facebook/'
);
$loginUrl = $facebook->getLoginUrl($params);
echo '<a href="'.$loginUrl.'"><img src="src/login-fb.gif" alt="Facebook Logout Button" /></a>';
}
?>
Thanks in advance.
I had the same problem:
When clicking on my logout link, Facebook ignored the “next” parameter, did not logout and redirect to facebook.com/home.php.
I added a final slash to my “next” URL and it solved my problem.
There is my code: