We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我使用的时候是否是第一次设置了cookie,之后的请求就不需要管了?因为我目前就是这样操作了,但是后续也不行,我设置的cookie如下: #pragma mark - 请求
(void)loadRequest { if (!self.url) { return; }
NSString *cookie = @"JSESSIONID=2E17260F9C95A42F654C1BC6E6BD215B; Path=/oa; HttpOnly; SHAREJSESSIONID=61efdf3a-4c1b-4eba-90b5-551c4e295c95; Path=/oa; HttpOnly; rememberMe=deleteMe; Path=/oa; Max-Age=0; Expires=Wed; 04-Dec-2019 08:24:38 GMT"; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:self.url]]; [request setValue:cookie forHTTPHeaderField:@"Cookie"]; [self.webView loadRequest:request]; } 在这人页面上有附件下载,点击,感觉这个cookie设置没有效果
The text was updated successfully, but these errors were encountered:
首次请求设置cookie是一个同步请求,这样是用于打开页面时才用得到,你的这个附件下载,是一个ajax请求,那这个ajax请求也是需要处理cookie问题的;后学的还有请求响应头,302重定向等问题,也是需要处理 cookie 问题的,你可以看下我写的博客,或者看下源码。
Sorry, something went wrong.
我先关闭了哈
No branches or pull requests
我使用的时候是否是第一次设置了cookie,之后的请求就不需要管了?因为我目前就是这样操作了,但是后续也不行,我设置的cookie如下:
#pragma mark - 请求
(void)loadRequest {
if (!self.url) {
return;
}
NSString *cookie = @"JSESSIONID=2E17260F9C95A42F654C1BC6E6BD215B; Path=/oa; HttpOnly; SHAREJSESSIONID=61efdf3a-4c1b-4eba-90b5-551c4e295c95; Path=/oa; HttpOnly; rememberMe=deleteMe; Path=/oa; Max-Age=0; Expires=Wed; 04-Dec-2019 08:24:38 GMT";
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:self.url]];
[request setValue:cookie forHTTPHeaderField:@"Cookie"];
[self.webView loadRequest:request];
}
在这人页面上有附件下载,点击,感觉这个cookie设置没有效果
The text was updated successfully, but these errors were encountered: