Cookie Interface
string
'D, d-M-Y H:i:s T'
getExpiresTimestamp( )
Get the timestamp from the expiration time
Timestamps are strings as large timestamps can overflow MAX_INT in 32bit systems.
getExpiry( )
Get the current expiry time
getFormattedExpires( )
Builds the expiration value part of the header string
getId( )
Get the id for a cookie
Cookies are unique across name, domain, path tuples.
getStringValue( )
Gets the cookie value as a string.
This will collapse any complex data in the cookie with json_encode()
isExpired( DateTime|DateTimeImmutable $time null )
Check if a cookie is expired when compared to $time
Cookies without an expiration date always return false.
$time
optional null withDomain( string $domain )
Create a cookie with an updated domain
$domain
Cake\Http\Cookie\CookieInterface
withExpired( )
Create a new cookie that will expire/delete the cookie from the browser.
This is done by setting the expiration time to 1 year ago
Cake\Http\Cookie\CookieInterface
withExpiry( DateTime|DateTimeImmutable $dateTime )
Create a cookie with an updated expiration date
$dateTime
Cake\Http\Cookie\CookieInterface
withHttpOnly( boolean $httpOnly )
Create a cookie with HTTP Only updated
$httpOnly
Cake\Http\Cookie\CookieInterface
withName( string $name )
Sets the cookie name
$name
Cake\Http\Cookie\CookieInterface
withNeverExpire( )
Create a new cookie that will virtually never expire.
Cake\Http\Cookie\CookieInterface
withPath( string $path )
Create a new cookie with an updated path
$path
Cake\Http\Cookie\CookieInterface
withSecure( boolean $secure )
Create a cookie with Secure updated
$secure
Cake\Http\Cookie\CookieInterface
withValue( string|array $value )
Create a cookie with an updated value.
$value
Cake\Http\Cookie\CookieInterface
© 2005–2018 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.5/class-Cake.Http.Cookie.CookieInterface.html