Can an iPhone application read cookies previously stored by Safari Mobile?
views:
1765answers:
3Although you have asked the same question twice before, here's one approach not yet mentioned...
This may be a little convoluted, but you can do Greasemonkey-esque things with a UIWebView. Something like this:
- Load your target page
- craft some javascript which will read the document.cookie and return the data you need
- In the webViewDidFinishLoad delegate, inject this javascript into the UIWebView with the stringByEvaluatingJavaScriptFromString message
I've used this technique to enhance 3rd party pages in an iPhone app, but I'm not sure if it will read cookies from the same place as Safari mobile.
Worth a shot though?
Thanks for the negative marks. A guy gets wrong answer and marked down for asking question in different more meaningful way. Bad day all round. Going to work with Mobile Safari JD database as I can't seem to solve this one.
To actually answer your question:
No.
Mobile Safari's cookies are not accessible from SDK apps. And each SDK app is given its own WebKit cache and cookie stores, so while cookies will persist within the same app, they aren't accessible betweeen apps.