博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ios 的cookie处理机制
阅读量:6817 次
发布时间:2019-06-26

本文共 1887 字,大约阅读时间需要 6 分钟。

hot3.png

简单说不管是NSURLConnection还是UIWebView都会保留并传递服务端的cookie,重启进程,或重启系统cookie都在应用中。

2.多个应用间默认是不共亨cookie的

3.删除重装应用cookie会被清除

Cookie Storage

Due to the stateless nature of the HTTP protocol, cookies are often used to provide persistent storage of data across URL requests. The URL loading system provides interfaces to create and manage cookies as well as sending and receiving cookies from web servers.

The  class encapsulates a cookie, providing accessors for many of the common cookie attributes. It also provides methods to convert HTTP cookie headers to instances and convert an NSHTTPCookie instance to headers suitable for use with an . The URL loading system automatically sends any stored cookies appropriate for an . unless the request specifies not to send cookies. Likewise, cookies returned in an  are accepted in accordance with the current cookie acceptance policy.

The  class provides the interface for managing the collection of  objects shared by all applications.

iOS Note: Cookies are not shared by applications in iOS.

 allows an application to specify a cookie acceptance policy. The cookie acceptance policy controls whether cookies should always be accepted, never be accepted, or accepted only from the same domain as the main document URL.

Note: Changing the cookie acceptance policy in an application affects the cookie acceptance policy for all other running applications.

When another application changes the cookie storage or the cookie acceptance policy,  notifies an application by posting theNSHTTPCookieStorageCookiesChangedNotification and NSHTTPCookieStorageAcceptPolicyChangedNotification notifications.

http://pathfindersoftware.com/2008/12/iphonesdk-cache-and-cookies/

https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Concepts/URLOverview.html#//apple_ref/doc/uid/20001834-157091

转载于:https://my.oschina.net/ahuaahua/blog/146900

你可能感兴趣的文章
jQuery学习之jQuery Ajax用法详解
查看>>
关于JEPLUS软件介绍——JEPLUS软件快速开发平台
查看>>
动态增加UIView到当前视图中
查看>>
怎么能看透信封
查看>>
找工作的程序员必懂的Linux
查看>>
JavaScript的浏览器兼容性问题小结。
查看>>
Oracle Hint的用法
查看>>
Postfix邮件系统
查看>>
《编写可读代码的艺术》读书文摘--第一部分 表面层次的改进
查看>>
使用Nodejs创建基本的网站 Microblog--《Node.js开发指南》 3
查看>>
网管工作是否值得做下去?
查看>>
神行者PD10-adb push逃脱ro权限
查看>>
JPA(四)之实体关系一对一
查看>>
如何使用羊驼自动生成缩略图的功能。
查看>>
定制化Azure站点Java运行环境(1)
查看>>
inotify用法简介及结合rsync实现主机间的文件实时同步
查看>>
php 判断手机登陆
查看>>
git 问题
查看>>
Fedora18设置终端快捷键 和 桌面快捷方式
查看>>
取消NavigationBar左右两边的空隙
查看>>