获取cookies

//cookies获取
            NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage];
            NSArray *cookieArr = [cookieJar cookies];
            NSString *cookies = @"";
            for(NSHTTPCookie *cookie in cookieArr) {
                NSLog(@"cookie -> %@", cookie);
                // 获取cookie
                if ([cookie.name isEqualToString:@"***"]) {
                    cookies = cookie.value;
                    break;
                }
            }

你可能感兴趣的:(获取cookies)