I am using the UIWebView to load the URL. I want to know how to clear the Cookies in that .
Asked
Active
Viewed 5,905 times
2 Answers
15
You can go through each cookie in the cookie jar and remove them.
How to delete all cookies of UIWebView?
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
[storage deleteCookie:cookie];
}

Community
- 1
- 1

Brandon Schlenker
- 5,078
- 1
- 36
- 58
-
Actually, I got this code when I googled. But implemented in wrong place. Now changed to proper place . It works. Thank you !!! – Perseus May 16 '12 at 11:15
1
NSHTTPCookie *cooki;
NSHTTPCookieStorage *data = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cooki in [data cookies]) {
[data deleteCookie:cooki];
}

Saad
- 8,857
- 2
- 41
- 51