public function setCookieJar ($file) {
    if (null !== $file) {
      $this->addCurlOption(CURLOPT_COOKIEFILE, $file); //read from file
      $this->addCurlOption(CURLOPT_COOKIEJAR, $file); //write to file
    }
    return $this;
  }