Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

UIWebView Cookies?

Hi,

How does one enable the use of cookies for a UIWebView, in an iPhone App? I have a JavaScript based web application that runs via storing and loading cookies, and it works on all platforms, expect the iPhone.

Does anyone know a solution to this? I've heard "NSHTTPCookieStorage" serves to control this behaviour, but how to implement it?

Any help would be much appreciated.

Thank you,
Boki

iMac (Intel Core 2 Duo), Mac OS X (10.6.2)

Posted on Jan 12, 2010 4:26 PM

Reply
6 replies

Jan 15, 2010 11:14 AM in response to kenoi

As the NSHTTPCookieStorage states, it is a singleton, hence any changes you make to the storage is available to any component that uses it (including UIWebView). Perhaps all you need is to set the cookie via a background NSURLConnection and then launch UIWebView...

http://blog.andrewpaulsimmons.com/2008/08/add-set-and-delete-cookies-in-uiwebvie w.html

UIWebView Cookies?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.