I want to port a python app that uses mechanize for the iPhone. This app needs to login to a webpage and using the site cookie to go to other pages on that site to get some
@zonble's answer only works in my localhost; If the server is not running locally, the "Set-Cookie" header is missing from the NSDictionary *fields = [HTTPResponse allHeaderFields];
Finally I found @benzado's solution works fine. Also see: iphone nsurlconnection read cookies @Tal Bereznitskey's answer.