Amp\Http\Cookie\RequestCookie class RequestCookie

A cookie as sent in a request's 'cookie' header, so without any 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): Amp\Http\Cookie\RequestCookie[]

Parses the cookies from a 'cookie' header.

Note: Parsing is aborted if there's an invalid value and no cookies are returned.

Type Parameter Description Default Value
string $string Valid 'cookie' header line. none
__construct — public function __construct(string $name, string $value = '')
No documentation.
Type Parameter Description Default Value
string $name Cookie name in its decoded form. none
string $value Cookie value in its decoded form. ''
getName — public function getName(): string
No documentation.
getValue — public function getValue(): string
No documentation.
__toString — public function __toString(): string
No documentation.