iOS WebView添加自定义cookie
作者:
静花寒 | 来源:发表于
2016-06-12 12:18 被阅读1786次NSDictionary *properties = [[NSMutableDictionary alloc] init];
[properties setValue:Member_Id forKey:NSHTTPCookieValue];
[properties setValue:@"memberId" forKey:NSHTTPCookieName];
[properties setValue:[[NSURL URLWithString:_info] host] forKey:NSHTTPCookieDomain];
[properties setValue:[[NSURL URLWithString:_info] path] forKey:NSHTTPCookiePath];
[properties setValue:[NSDate dateWithTimeIntervalSinceNow:60*60] forKey:NSHTTPCookieExpires];
NSHTTPCookie *cookie = [[NSHTTPCookie alloc] initWithProperties:properties];
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie];
[_scanDetailWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_info]]];
本文标题:iOS WebView添加自定义cookie
本文链接:https://www.haomeiwen.com/subject/qlmedttx.html
网友评论