What happens to cookies of webview on closing the application?

大兔子大兔子 提交于 2019-12-06 04:31:01

问题


i am using a webview in an app which has keep me signed in functionality like facebook app.so in order to implement i need that the cookie should be persistant.I just wanted to know whether ios persists the cookie by default when the app is closed or i need to save the cookie manually before closing the app to implement keep me signed in functionality.

any help would be deeply appreciated. Thanks


回答1:


You want to use a NSHTTPCookieStorage object to manage the cookies. The short answer to your question is to use NSHTPPCookieStorage which will distribute the shared instance. You can use this instance to get/set cookie information.

Take a look at the Apple documentation for NSHTTPCookieStorage, as well as the following two posts:

Where are an UIWebView's cookies stored?

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

These should get you started down the right track.



来源:https://stackoverflow.com/questions/9273063/what-happens-to-cookies-of-webview-on-closing-the-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!