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);
	}