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

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

博客园 - 木饭

码农必读的 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