I have searched almost all questions on StackOverflow for answer to my question. I haven't found any useful link or tutorial saying which way is best to clear cookies for particular domain. So please if someone could help me.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
I found solution myself. If you wish to delete entire cookies in your UIWebView do this.
If you wish to delete cookies specific to one site or domain do this.
In above code i have used siteName (or) DomainName replace it with site for which you want to remove cookies. You must know that every domain has subdomain. If you give gobal domain name in that place it wont delete cookies for subDomains. For Example LinkedIn, it has many subDomains like in.linkedIn.com, api.linkedIn.com etc. If i give http://www.linkedin.com which is gobal domain name it wont delete cookies for subdomains.
NSHTTPCookie has domain property so use that to get all domain names and using rangeOfString: method of NSString get domains which has your String(for example linkedin). Than do deletion on it will delete cookies for all its domain.
I had no one for helping i hope at least my post will help someone in future.