In my app I implemented login using Facebook and Google+. Given scenario:
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?
You can try this way. When you use FB to login you can first use logout
FBSDKLoginManager *manager = [[FBSDKLoginManager alloc] init];
//manager.loginBehavior=FBSDKLoginBehaviorWeb;
[manager logOut];
Hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.