Curl\Curl::setCookieJar PHP Method

setCookieJar() public method

Set Cookie Jar
public setCookieJar ( $cookie_jar )
$cookie_jar
    public function setCookieJar($cookie_jar)
    {
        $this->setOpt(CURLOPT_COOKIEJAR, $cookie_jar);
    }

Usage Example

Example #1
0
 /**
  * @author mohuishou<*****@*****.**>
  * @param $key
  * @return array
  */
 public function loginCollege($key)
 {
     $this->_curl->setOpt(CURLOPT_SSL_VERIFYPEER, false);
     $this->_curl->setCookieJar(__DIR__ . '/../cookie/college-' . $this->_uid . '.cookie');
     $this->_curl->get($this->_url_login_college, array('CTgtId' => $key));
     if ($this->_curl->error) {
         echo 'Error: ' . $this->_curl->errorCode . ': ' . $this->_curl->errorMessage;
     } else {
         $this->_college_cookie = $this->_curl->getResponseCookies();
         return $this->_college_cookie;
     }
 }
All Usage Examples Of Curl\Curl::setCookieJar