惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - 木饭

码农必读的 7 本计算机书 我已经三十多岁了,我该把时间投资在哪呢? SQL SERVER 2012 第五章 创建和修改数据表 の CREATE语句 SQL SERVER 2012 第五章 创建和修改数据表 の SQL SERVER中的对象名 SQL SERVER 2012 第四章 连接 JOIN语句的早期语法结构 & 联合UNION SQL SERVER 2012 第四章 连接 JOIN の OUTER JOIN,完全连接FULL JOIN,交叉连接CROSS JOIN C#高级编程第9版 第二章 核心C# 读后笔记 SQL SERVER 2012 第四章 连接 JOIN の INNER JOIN SQL SERVER 2012 第三章 使用INSERT语句添加数据 SQL SERVER 2012 第三章 T-SQL 基本语句 having子句 SQL SERVER 2012 第三章 T-SQL 基本语句 group by 聚合函数 C#高级编程第9版 第一章 .NET体系结构 读后笔记 SQL SERVER 2012 第三章 T-SQL 基本SELECT语句用法,Where子句详细用法 无法打开物理文件 "X.mdf"。操作系统错误 5:"5(拒绝访问。)"。 (Microsoft SQL Server,错误: 5120)解决 MVC view页面需要多个model,复杂网页的处理 中国福利彩票,牛B,开奖和数据传输有什么关系? Mvcpager以下各节已定义,但尚未为布局页“~/Views/Shared/_Layout.cshtml”呈现:“Scripts”。 骆驼男鞋怎么样,骆驼男鞋售后逆天,骆驼男鞋维修36天无结果。程序员屌丝的维权之路,直播。。。。。。 IOS7状态栏StatusBar官方标准适配方法
iphone原生cookie处理
木饭 · 2013-11-19 · via 博客园 - 木饭

可以使用NSURLConnection的类来执行HTTP请求,登录该网站,并检索的cookie。 要执行一个请求,只是创建一个NSURLConnection的实例,并分配给它的委托对象。

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURLURLWithString:@"http://www.google.com/"]];
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];

然后,执行一个委托方法。

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse*)response
{
    
NSHTTPURLResponse *HTTPResponse = (NSHTTPURLResponse *)response;
    
NSDictionary *fields = [HTTPResponse allHeaderFields];
    
NSString *cookie = [fields valueForKey:"Set-Cookie"]; // It is your cookie
}

保留或复制cookie字符串。 当您要执行另一个请求,将它添加到您对您的NSURLRequest实例的HTTP标头。

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURLURLWithString:@"http://www.google.com/"]];
[request addValue:cookie forHTTPHeaderField:"Cookie"];

NSURLConnection的自动存储和发送的Cookie

原文:http://stackoverflow.com/questions/2053568/managing-http-cookies-on-iphone