public function SetCookie::__construct in Lockr 7.3
Parameters
array $data Array of cookie data provided by a Cookie parser:
File
- vendor/
guzzlehttp/ guzzle/ src/ Cookie/ SetCookie.php, line 72
Class
- SetCookie
- Set-Cookie object
Namespace
GuzzleHttp\CookieCode
public function __construct(array $data = []) {
$this->data = array_replace(self::$defaults, $data);
// Extract the Expires value and turn it into a UNIX timestamp if needed
if (!$this
->getExpires() && $this
->getMaxAge()) {
// Calculate the Expires date
$this
->setExpires(time() + $this
->getMaxAge());
}
elseif ($this
->getExpires() && !is_numeric($this
->getExpires())) {
$this
->setExpires($this
->getExpires());
}
}