How to completely Logout of Facebook SDK Auth in iOS App

Viewed 6189

using FBSDKCoreKit 4.22.1

I have an app installed publicly, servicing multiple users during the day. A person can walk up to the iPad and login with their Facebook account:

enter image description here

After successful login, than can do their work and use the app and than they will logout some time later: enter image description here

The Logout happens successfully. Then the next user comes up to use the public iPad and clicks the Facebook Login button, yet they will see:enter image description here

The FBSDKLoginManager or other Facebook SDK Libs has remembered some elements of the previous user's Facebook login.

I want to completely clear out any information about the previous user's Facebook credentials

After successful Logout, this FBSDKLoginButtonDelegate method is called and I have tried the following to completely remove the Facebook account info with no success:

func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!) {
    print("\(#function) in \(#file.components(separatedBy: "/").last ?? "")")
    print("Todo, must completely remove Facebook Auth token info for current user logging out")
    FBSDKAccessToken.setCurrent(nil)
    FBSDKLoginManager().logOut()
    FBSDKProfile.setCurrent(nil)
}

So with FBSDKCoreKit 4.22.1 Safari browser is used to open the Facebook authentication redirect URL and that Javascript uses local storage:enter image description here

Interestingly, Blocking all Cookies, which Apple implies will also block Website Data (localStorage), does NOT block local storage and Facebook and still create Web Site data stores: enter image description here

Apple says here:

"Change which cookies and website data are accepted: Select a “Cookies and website data” option:"

  • "Always block: Safari doesn’t let any websites, third parties, or advertisers store cookies and other data on your Mac. This may prevent some websites from working properly."

And that is where I expect Local Storage to be blocked as well as cookies but Facebook can still create local storage entries

3 Answers
Related