[iPhone] Cookies in UIWebView not accepted anymore after update to iOS 4.2.1

392 views
Skip to first unread message

guggero

unread,
Nov 30, 2010, 6:05:23 AM11/30/10
to phonegap
Hi

I know, this is probably a bug in the iOS update 4.2.1 but I'm posting
here with the hope that someone might have a workaround or fix for the
problem.

I use phonegap to load content from a site through HTTPS with the
jQuery functions $.get and $.post. The site requires a login and
stores the session information in a cookie (with the "secure" flag
set).
This worked perfectly in iOS up to 4.1 thanks to the following code:

NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage
sharedHTTPCookieStorage];
[cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];

But since i updated my iPhone to iOS 4.2.1 it seems that the UIWebView
does not accept/store the cookies anymore. And therefore the login
does not work anymore.

I cannot change anything on the server. And I would like to avoid the
worst case scenario where I would have to write the HTTPS-requests
myself using NSURLConnection, since that would mean that it would not
be a cross platform solution anymore.

After long hours of googling for a solution I gave up and hope that
someone here could give me an idea how to fix this.
I'm thankful for any hint concerning this topic.

Cheers,
guggero
Reply all
Reply to author
Forward
0 new messages