public function setCookie ($cookie)
	{
		//if cookie is sent as key=>value array
		if (is_array($cookie))
		{
			$cookies_data = [];
			foreach ($cookie as $key => $value)
			{
				$cookies_data[] = "{$key}={$value}";
			}

			//and implode (useful if more than one cookie is sent along so we separate them by ;)
			$cookie = implode('; ', $cookies_data);
		}

		curl_setopt($this->ch, CURLOPT_COOKIE, $cookie);
	}
public function setCookie ($cookie)
	{
		//if cookie is sent as key=>value array
		if (is_array($cookie))
		{
			$cookies_data = [];
			foreach ($cookie as $key => $value)
			{
				$cookies_data[] = "{$key}={$value}";
			}

			//and implode (useful if more than one cookie is sent along so we separate them by ;)
			$cookie = implode('; ', $cookies_data);
		}

		curl_setopt($this->ch, CURLOPT_COOKIE, $cookie);
	}
public function setCookie ( $ cookie ) { //if cookie is sent as key=>value array if ( is_array ( $ cookie ) ) { $ cookies_data = [ ] ; foreach ( $ cookie as $ key => $ value ) { $ cookies_data [ ] = "{$key}={$value}" ; } //and implode (useful if more than one cookie is sent along so we separate them by ;) $ cookie = implode ( '; ' , $ cookies_data ) ; } curl_setopt ( $ this -> ch , CURLOPT_COOKIE , $ cookie ) ; }
Set custom cookie

@param mixed string or array with key=>value (i.e. array('foo'=>'value'))

@access public
Set custom cookie