Amp\Http\Cookie\ResponseCookie class ResponseCookie

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 function fromHeader(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 function getName(): string
No documentation.
getValue — public function getValue(): string
No documentation.
getExpiry — public function getExpiry(): DateTimeImmutable|null
No documentation.
getMaxAge — public function getMaxAge(): int|null
No documentation.
getPath — public function getPath(): string
No documentation.
getDomain — public function getDomain(): string
No documentation.
isSecure — public function isSecure(): bool
No documentation.
isHttpOnly — public function isHttpOnly(): bool
No documentation.
getAttributes — public function getAttributes(): Amp\Http\Cookie\CookieAttributes
No documentation.
__toString — public function __toString(): string
No documentation.