0
僅當我首先登錄時才能訪問虛構頁面www.randomDomain.com/onlyForRegisteredUsers
。所以 我這樣做:如何在php中使用curl保持會話信息?
...
curl_setopt($this->curl, CURLOPT_HEADER, false);
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($this->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($this->curl, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($this->curl, CURLOPT_TIMEOUT, 10);
curl_setopt($this->curl, CURLOPT_USERAGENT, $this->currentUseragent;
curl_setopt($this->curl, CURLOPT_PROXY, $this->currentIP);
curl_setopt($this->curl, CURLOPT_URL, $this->currentUrl); //www.randomDomain.com/login/
curl_setopt($this->curl, CURLOPT_POST, true);
curl_setopt($this->curl, CURLOPT_POSTFIELDS, $this->currentData);
//with login RandomUserName and pass *******
$page = curl_exec($this->curl);
,併成功在$頁我已經得到的結果是這樣的:...<p>Welcome back, RandomUserName!</p>
。
如何保持有關會議的信息,我已經登錄,然後從www.randomDomain.com/onlyForRegisteredUsers
閱讀內容?