了解 iPhone 的 NSHTTPCookieStorage [英] Understanding NSHTTPCookieStorage for the iPhone

查看:24
本文介绍了了解 iPhone 的 NSHTTPCookieStorage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我遗漏了一些东西,但是从 Apple 的 NSHTTPCookieStorage 文档,我不禁想知道这是如何安全使用的.

Maybe I'm missing something, but from Apple's documentation for NSHTTPCookieStorage, I can't help but wonder how this is safe to use.

这是否意味着 cookie 存储在 iPhone 上的所有应用程序之间共享?如果我的应用进行 Http 调用导致一些 cookie 被保存,那么所有应用现在都可以访问这些 cookie 了吗?

Does this mean that cookie storage is shared across all apps on the iPhone? If my app makes an Http call that results in some cookies being saved, do all apps now have access to these cookies?

方法如:

cookiesForURL:返回所有将发送的接收者 cookie到指定的网址.

cookiesForURL: Returns all the receiver's cookies that will be sent to a specified URL.

让它看起来更加可疑.

有人可以解释一下这是怎么回事,以及班级是做什么的吗?

Can someone explain how this is OK, and what the class does?

此外,假设我的理解有缺陷,并且这确实是每个应用程序的沙盒,使用 NSURLRequest 进行的调用会自动保存/检索此存储中的 cookie,或者开发人员有责任在此之前设置请求标头分派请求?

Also, assuming my understanding is flawed and this is indeed sandboxed per-app, do calls made using NSURLRequest automatically save/retrieve cookies from this store or is it the developers responsibility to set request headers before dispatching the request?

推荐答案

您的应用程序只能访问其自身沙箱中的 cookie.

Your application only has access to cookies within its own sandbox.

这篇关于了解 iPhone 的 NSHTTPCookieStorage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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