UIWebView的Cookie存储在哪里? [英] Where are an UIWebView's cookies stored?
问题描述
我正在使用Cookie建立iPhone应用程式。在Safari设置中删除Cookie不会将其删除。他们在哪里存储?是否可以从另一个UIWebView读取它们?
I'm building an iPhone app with cookies. Deleting cookies in the Safari settings doesn't delete them. Where are they stored? Is it possible to read them from another UIWebView?
谢谢!
推荐答案
p>您的应用程序在 [NSHTTPCookieStorage sharedHTTPCookieStorage]
容器中有自己的cookie jar。
Your application has its own "cookie jar" in the [NSHTTPCookieStorage sharedHTTPCookieStorage]
container.
您可以快速查看应用程序的cookie jar中的cookie:
Here's how you might take a quick look at the cookies in your application's cookie jar:
NSHTTPCookie *cookie;
NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [cookieJar cookies]) {
NSLog(@"%@", cookie);
}
有几种方法可用于过滤和操作。请查看 NSHTTPCookieStorage 访问Cookie的文档,以及 NSHTTPCookie < a>访问各个Cookie属性的文档。
Several methods are available for filtering and manipulation. Take a look at the NSHTTPCookieStorage documentation for accessing cookies, and the NSHTTPCookie documentation for accessing individual cookie properties.
这篇关于UIWebView的Cookie存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!