关闭应用程序时,webview的cookie会如何处理? [英] What happens to cookies of webview on closing the application?

查看:48
本文介绍了关闭应用程序时,webview的cookie会如何处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个应用程序中使用了Webview,该应用程序使我保持登录Facebook app.so之类的功能.因此,要实施该程序,我需要cookie可以持久化./strong>默认情况下,当应用程序关闭时,或者我需要在关闭应用程序之前手动保存 cookie ,以实现保持登录状态.

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

推荐答案

您要使用 NSHTTPCookieStorage 对象来管理cookie.您问题的简短答案是使用 NSHTPPCookieStorage 它将分发共享实例.您可以使用此实例获取/设置Cookie信息.

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.

看看 NSHTTPCookieStorage 的Apple文档以及以下两篇文章:

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

UIWebView的cookie存储在哪里?

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

这些应该使您开始正确的道路.

These should get you started down the right track.

这篇关于关闭应用程序时,webview的cookie会如何处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆