New to programming, learning from Youtube and from You Guys ! Thanks a lot.
After intentionally entering wrong credentials on the webpage login inside the web view , the webpage normally shows an error of login. I added a reset button on the app interface to reload the MAIN WebApp web view. It reloads and shows the same webpage login error. (instead of reloading the main webpage cache free to allow entering the proper credentials again) I tried to add clear cache function with no success.
@IBAction func RefreshApp(_ sender: UIButton) {
viewdidload()
}
In viewdidload, i have included :
URLCache.shared.removeAllCachedResponses()
URLCache.shared.diskCapacity = 0
URLCache.shared.memoryCapacity = 0
with no success
This is working in Swift 3.1 , XCode 8.3.1 :
//Delete Cookies
if let cookies = HTTPCookieStorage.shared.cookies {
for cookie in cookies {
NSLog("\(cookie)")
}
}
let storage = HTTPCookieStorage.shared
for cookie in storage.cookies! {
storage.deleteCookie(cookie)
}