Clearing of app cache in iOS works for Google+ login, but doesn't work for Facebook

Viewed 968

In my app I implemented login using Facebook and Google+. Given scenario:

  • I logged in using fb account 1
  • I would like to login using fb account 2, so I log out
  • On safari view I get message "You have already granted permissions to your app"

Which is ok end expected. User needs to log out from Safari browser. But I would like to do it by myself by cleaning cookies and URLCache:

    URLCache.shared.removeAllCachedResponses()
    URLCache.shared.diskCapacity = 0
    URLCache.shared.memoryCapacity = 0

    if let cookies = HTTPCookieStorage.shared.cookies {
        for cookie in cookies {
            HTTPCookieStorage.shared.deleteCookie(cookie)
        }
    }

This code erases data for Google+, but doesn't change anything for Facebook. Is it the expected behavior? Why? If no - what is the way to clean Facebook data as well?

1 Answers
Related