本文整理汇总了PHP中HttpClient::setRawCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpClient::setRawCookie方法的具体用法?PHP HttpClient::setRawCookie怎么用?PHP HttpClient::setRawCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpClient
的用法示例。
在下文中一共展示了HttpClient::setRawCookie方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readHeader
private function readHeader()
{
// read header
while (($line = $this->conn->getLine()) !== null) {
if ($line === false) {
return $this->finish('BROKEN');
}
if ($line === '') {
$this->headerOK = true;
$this->chunkLeft = 0;
return $this->readBody();
}
HttpClient::debug('read header line: ', $line);
if (!strncmp('HTTP/', $line, 5)) {
$line = trim(substr($line, strpos($line, ' ')));
list($this->res->status, $this->res->statusText) = explode(' ', $line, 2);
$this->res->status = intval($this->res->status);
} else {
if (!strncasecmp('Set-Cookie: ', $line, 12)) {
$cookie = $this->parseCookieLine($line);
if ($cookie !== false) {
$this->res->setRawCookie($cookie['name'], $cookie['value']);
$this->cli->setRawCookie($cookie['name'], $cookie['value'], $cookie['expires'], $cookie['domain'], $cookie['path']);
}
} else {
list($k, $v) = explode(':', $line, 2);
$this->res->addHeader($k, trim($v));
}
}
}
}