code: private void addHeader(String k, String v) {
      if (k != null && (k.equalsIgnoreCase("Set-Cookie") || k.equalsIgnoreCase("Set-Cookie2"))) {
        CookieSplitter cs = new CookieSplitter(v);
        while (cs.hasNext()) {
          headers.add(new HeaderEntry(k, cs.next()));
        }
      } else {
        headers.add(new HeaderEntry(k, v));
      }
    }
docs: /*-[
  - (void)URLSession:(NSURLSession *)session
  task:(NSURLSessionTask *)task
  willPerformHTTPRedirection:(NSHTTPURLResponse *)response
  newRequest:(NSURLRequest *)request
  completionHandler:(void (^)(NSURLRequest *))completionHandler {
  if (self->instanceFollowRedirects_
  && [response.URL.scheme isEqualToString:request.URL.scheme]) {
  completionHandler(request);
  } else {
  completionHandler(nil);
  }
  }
  ]-