Add, Set, and Delete Cookies in UIWebView with NSHTTPCookieStorage
To get the cookies for any url use:
NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
NSArray* theCookies = [cookieStorage cookiesForURL:[NSURL URLWithString:@"http://example.com"]];
This makes it possible to easily login or logout a user from a website presented in your UIWebView.
Checkout NSHTTPCookieStorage* for all the details.
Labels: Cocoa, iPhone, Objective-C, UIKit

