I am executing the following code to logout of Facebook from my iPhone application:
if ([mFacebook isSessionValid]) {
[mFacebook logout];
}
This code runs successfully and the delegate is called after this in which I am clearing the access token:
- (void)fbDidLogout
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults removeObjectForKey:@"FBAccessTokenKey"];
[defaults removeObjectForKey:@"FBExpirationDateKey"];
[defaults synchronize];
}
But when I again log in to Facebook, it does not ask for username and password.
What am I doing wrong?
Are you using FB mobile Login Dialog? In Facebook.m, add the following code to remove cookies at m.facebook.com domain.