How do I close aCtive Session Of the Facebook-iOS-Sdk each time when i start my app either after killing app it gives me the previous login session details. When I click on the facebook Button .I have used everything [appDelegate.session closeAndClearTokenInformation]; [FBSession.activeSession close]; [FBSession.activeSession closeAndClearTokenInformation] ..but active session still not been close..how do i close the Previous session data on clicking.

I use the below code to clear but whenever I click on the facebook button to start new session..it gives me back the previous credentials.

- (IBAction)buttonClickHandler:(id)sender {

appDelegate = [[UIApplication sharedApplication]delegate];

// this button's job is to flip-flop the session from open to closed
if (appDelegate.session.isOpen) {

    [appDelegate.session closeAndClearTokenInformation];
    [FBSession.activeSession close];
    [FBSession.activeSession  closeAndClearTokenInformation];
    FBSession.activeSession=nil;

} else {
    if (appDelegate.session.state != FBSessionStateCreated) {
        // Create a new, logged out session.
        appDelegate.session = [[FBSession alloc] init];
    }

    // if the session isn't open, let's open it now and present the login UX to the user
    [FBSession.activeSession closeAndClearTokenInformation];
    FBSession.activeSession=nil;
    [FBSession.activeSession openWithBehavior:FBSessionLoginBehaviorForcingWebView

                            completionHandler:^(FBSession *session,

                                                FBSessionState state,

                                                NSError *error) {
                                // and here we make sure to update our UX according to the new session state

                                NSLog(@" state=%d",state);

                                [FBRequestConnection
                                 startForMeWi
Edit
Report