function SetCookie::setExpires
Set the unix timestamp for which the cookie will expire.
Parameters
int|string|null $timestamp Unix timestamp or any English textual datetime description.:
1 call to SetCookie::setExpires()
- SetCookie::__construct in vendor/
guzzlehttp/ guzzle/ src/ Cookie/ SetCookie.php
File
-
vendor/
guzzlehttp/ guzzle/ src/ Cookie/ SetCookie.php, line 291
Class
- SetCookie
- Set-Cookie object
Namespace
GuzzleHttp\CookieCode
public function setExpires($timestamp) : void {
if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp));
}