开发者

Don't get all cookies from NSHTTPURLResponse or NSHTTPCookieStorage

I'm trying to programmatically submit a form using a NSURLConnection.

To make sure I get the proper response when sending the form, I collect the form using an NSURLConnection, collect all the cookies from the corresponding NSHTTPURLResponse, scrape the form, fill it out and resubmit it to the web server with the cookies from the NSHTTPURLResponse.

However, I've noticed that neither NSHTTPCookieStorage nor the NSHTTPURLResponse have all the cookies that the web server is sending back.

I've compared the contents of the following two methods [[NSHTTPURLResponse allHeaderFields] valueForKey:@"Set-Cookie"] and [[NSHTTPCookieStorage sharedHTTPCookieStora开发者_JS百科ge] cookies] to the response seen through a web proxy and simply telnet.

The response seen through the web proxy and telnet show all the same "Set-Cookie" fields.

The string from NSHTTPURLResponse and array from NSHTTPCookieStorage neither agree with one another nor the results from the web proxy/telnet. Can someone suggest why that might be?

Thanks,

Jason Mazzotta

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜