Persistencia de cookies de vista web de iPhone

When using a web view and closing the app then opening it backup, do cookies persist? (For example to keep a logged in state)

¿Es esto posible?

preguntado el 08 de noviembre de 11 a las 18:11

3 Respuestas

No, the cookies won't persist.

Here's a solution i hacked together today: https://gist.github.com/maciekish/6268142

Please note that the initial NSURLRequest you pass the UIWebView won't have the cookies unless you set hem.

Respondido 19 ago 13, 15:08

@AndersR.Bystrup Litte fast moderation there perhaps? He asked if cookies will persist when the app is restarted. The answer is no. How is that not an answer to the question? - Maciej Swic

Can't tell you why, but my UIWebView persists cookies and session by default, even when I force-close my app. So not really sure about the previous statements.

Respondido el 14 de diciembre de 13 a las 07:12

The cookies works just like mobile browser. But the only limitation is the cookie is NOT shared with browser, and different webviews has separated cookies storage.

Respondido 24 Abr '12, 04:04

This is not correct. Cookies in a UIWebView will not persist between app runs. - Maciej Swic

the lifetime of cookies will be defined by the web server. it could be session based which expires after webview is closed or one hour/one month which persists. - larry

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.