Can an iPhone xcode application read cookies previously stored by Safari Mobile?

前端 未结 8 941
日久生厌
日久生厌 2020-11-28 10:05

Can an iPhone application read cookies previously stored by Safari Mobile?

8条回答
  •  执念已碎
    2020-11-28 10:26

    Although 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?

提交回复
热议问题