首页 > 其他 > 详细

获取cookie

时间:2015-09-12 09:36:17      阅读:249      评论:0      收藏:0      [点我收藏+]

NSHTTPCookieStorage *sharedHTTPCookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];

    NSArray *cookies = [sharedHTTPCookieStorage cookiesForURL:[NSURL URLWithString:@"file:///Users/jason/Library/Developer/CoreSimulator/Devices/FDFE739C-A564-4F15-8609-C527B436D6E5/data/Containers/Data/Application/7348B5F3-F859-4F16-9DAB-D5B6D3ECEDF9/Documents/html/center.html"]];

    NSEnumerator *enumerator = [cookies objectEnumerator];

    NSHTTPCookie *cookie;

    while (cookie = [enumerator nextObject]) {

        NSLog(@"COOKIE{name: %@, value: %@}", [cookie name], [cookie value]);

    }

获取cookie

原文:http://www.cnblogs.com/bing-ge/p/4802556.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!