Amp\Http\Cookie\ResponseCookie classResponseCookie

A cookie as sent in a response's 'set-cookie' header, so with attributes.

This class does not deal with encoding of arbitrary names and values. If you want to use arbitrary values, please use an encoding mechanism like Base64 or URL encoding.

Summary

Properties

Methods

Properties

Methods

fromHeader —public functionfromHeader(string$string):self|null

Parses a cookie from a 'set-cookie' header.

Type Parameter Description Default Value
string $string Valid 'set-cookie' header line. none
__construct —public function__construct(string$name,string$value ='',Amp\Http\Cookie\CookieAttributes$attributes =null)
No documentation.
Type Parameter Description Default Value
string $name Name of the cookie. none
string $value Value of the cookie. ''
Amp\Http\Cookie\CookieAttributes $attributes Attributes of the cookie. null
getName —public functiongetName():string
No documentation.
getValue —public functiongetValue():string
No documentation.
getExpiry —public functiongetExpiry():DateTimeImmutable|null
No documentation.
getMaxAge —public functiongetMaxAge():int|null
No documentation.
getPath —public functiongetPath():string
No documentation.
getDomain —public functiongetDomain():string
No documentation.
isSecure —public functionisSecure():bool
No documentation.
isHttpOnly —public functionisHttpOnly():bool
No documentation.
getAttributes —public functiongetAttributes():Amp\Http\Cookie\CookieAttributes
No documentation.
__toString —public function__toString():string
No documentation.