I am using facebook-php-sdk (github) for facebook login on my localhost page, when i logout, the page is not redirecting..
And the same page i can see the my profile information in arrays, even after i pressed logout then data should be empty on page but its display all information.
i have used below code, but its not redirect
$logoutUrl = $facebook->getLogoutUrl(array('next' => 'http://google.com'));
<?php if ($user): ?>
<a href="<?php echo $logoutUrl; ?>">Logout</a>
<?php else: ?>
<div>
Login using OAuth 2.0 handled by the PHP SDK:
<a href="<?php echo $loginUrl; ?>">Login with Facebook</a>
</div>
<?php endif ?>
The only way to have a succesful logaut using the PHP SDK was this for me: redirect the logout button to a function and do the following
i actually redirected the user after unsetting facebook session. Remember that if you are setting an acces token programmatically in the instyance of the Facebook class you must invalidate the token too