Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found solution myself. If you wish to delete entire cookies in your UIWebView do this.</p> <pre><code>NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; NSHTTPCookie *cookie; for (cookie in [storage cookies]) { NSLog(@"%@", cookie); // Print the deleted cookie. [storage deleteCookie:cookie]; } [[NSUserDefaults standardUserDefaults] synchronize]; </code></pre> <p>If you wish to delete cookies specific to one site or domain do this.</p> <pre><code>NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; NSHTTPCookie *cookie; for(cookie in [storage cookies]) { if([[cookie domain] rangeOfString:@"siteName(or)domainName"].location != NSNotFound) { NSLog(@"cookie to be deleted:%@", cookie); [storage deleteCookie:cookie]; } } </code></pre> <p>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 <a href="http://www.linkedin.com" rel="noreferrer">http://www.linkedin.com</a> which is gobal domain name it wont delete cookies for subdomains. </p> <p>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.</p> <p>I had no one for helping i hope at least my post will help someone in future.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload