function SetCookie::setMaxAge
Set the max-age of the cookie.
Parameters
int|null $maxAge Max age of the cookie in seconds:
1 call to SetCookie::setMaxAge()
- SetCookie::__construct in vendor/
guzzlehttp/ guzzle/ src/ Cookie/ SetCookie.php
File
-
vendor/
guzzlehttp/ guzzle/ src/ Cookie/ SetCookie.php, line 267
Class
- SetCookie
- Set-Cookie object
Namespace
GuzzleHttp\CookieCode
public function setMaxAge($maxAge) : void {
if (!is_int($maxAge) && null !== $maxAge) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Max-Age'] = $maxAge === null ? null : (int) $maxAge;
}