title: When a user logs out of my iOS app, the next time they try to login with Facebook, they should have to re-enter their login credentials
body: <p>I'm building an iOS app with Parse and Facebook frameworks.</p>
  
  <p>I log the user in</p>
  
  <pre><code>-(void)updateUserInformation
  {
  
      FBRequest *request = [FBRequest requestForMe];
  
      [request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
  
          if (!error){
  
              NSDictionary *userDictionary = (NSDictionary *)result;
  
              NSString *facebookID = userDictionary[@"id"];
              NSURL *pictureURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?type=large&amp;return_ssl_resources=1", facebookID]];
  
              NSMutableDictionary *userProfile = [[NSMutableDictionary alloc]initWithCapacity:8];
              if (userDictionary[@"name"]){
                  userProfile[kJFUserProfileNameKey] = userDictionary[@"name"];
              }
              if (userDictionary[@"first_name"]){
                  userProfile[kJFUserProfileFirstNameKey] = userDictionary[@"first_name"];
              }
              if (userDictionary[@"location"][@"name"]){
                  userProfile[kJFUserProfileLocationKey] = userDictionary[@"location"][@"name"];
              }
              if (userDictionary[@"gender"]){
                  userProfile[kJFUserProfileGenderKey] = userDictionary[@"gender"];
              }
              if (userDictionary[@"birthday"]){
                  userProfile[kJFUserProfileBirthdayKey] = userDictionary[@"birthday"];
                  NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
                  [formatter setDateStyle:NSDateFormatterShortStyle];
                  NSDate *date = [formatter dateFromString:userDictionary[@"birthday"]];
                  NSDate *now = [NSDate date];
                  NSTimeInterval seconds = [now timeIntervalSinceDate:date];
                  int age = seconds / 31536000;
                  userProfile[kJFUserProfileAgeKey] = @(age);
              }
              if (userDictionary[@"interested_in"]){
                  userProfile[kJFUserProfileInterestedInKey] = userDictionary[@"interested_in"];
              }
              if (userDictionary[@"relationship_status"]){
                  userProfile[kJFUserProfileRelationshipStatusKey] = userDictionary[@"relationship_status"];
              }
              if ([pictureURL absoluteString]){
                  userProfile[kJFUserProfilePictureURL] = [pictureURL absoluteString];
              }
  
              [[PFUser currentUser] setObject:userProfile forKey:kJFUserProfileKey];
              [[PFUser currentUser] saveInBackground];
  
          }
  
      }];
  
  }
  
  #pragma mark - from initial login controller
  
  
  
  - (IBAction)loginWithFBButtonPressed:(UIButton *)sender {
  
      NSArray *permissionsArray = @[ @"user_about_me", @"user_relationships", @"user_birthday", @"user_location", @"user_friends"];
  
      [PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) {
          [_activityIndicator stopAnimating]; // Hide loading indicator
  
          if (!user) {
              if (!error) {
                  NSLog(@"Uh oh. The user cancelled the Facebook login.");
              } else {
                  NSLog(@"Uh oh. An error occurred: %@", error);
              }
          } else{
              [self performSegueWithIdentifier:@"loginToMainSegue" sender:self];
              [self updateUserInformation];
          }
      }];
  
  }
  </code></pre>
  
  <p>No problem logging users in or out. But when I do log the user out and pop to the root view controller (the one with the "login with facebook" button), if I click that button, Facebook opens on a Safari tab with the last user's Facebook account already active. Instead of having to enter login information, the user gets the message "You have already authorized <em>thisApp</em>" and a "cancel" and "ok" button.</p>
  
  <p>The logout button is occurring from within a TableViewController.</p>
  
  <p><strong>[UPDATE 1]</strong></p>
  
  <p>Even after implementing these additional methods, my user is still logged into Facebook. I tried the unLink method but that doesn't seem to be what I'm after, because after doing that, when I log a user back in, that user's in-app data no longer is attributed to him.</p>
  
  <pre><code>if (indexPath.row == 3) {
      identifier = nil;
  
      NSLog(@"pressed logout");
  
      [PFUser logOut];
      [[PFFacebookUtils session]closeAndClearTokenInformation];
      [[PFFacebookUtils session]close];
      [[FBSession activeSession]closeAndClearTokenInformation];
      [[FBSession activeSession]close];
      [FBSession setActiveSession:nil];
  
      [self.navigationController popToRootViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>What do I have to do to actually log the user out of Facebook from the phone itself, as opposed to just from this current session on the app?</p>