class Cookie

Class Cookie

Constants

ATTR_DOMAIN

ATTR_PATH

ATTR_SECURE

ATTR_MAX_AGE

ATTR_EXPIRES

Properties

protected $name
protected $value
protected $attributes
protected $createdAt

Methods

__construct()

Constructor.

bool
matchesRequest(RequestInterface $request)

Returns true if the current cookie matches the supplied request

boolean
isExpired()

Returns true of the current cookie has expired.

boolean
matchesDomain(string $domain)

Returns true if the current cookie matches the supplied domain.

boolean
matchesPath(string $path)

Returns true if the current cookie matches the supplied path.

fromSetCookieHeader(string $header, string $issuingDomain)

Populates the current cookie with data from the supplied Set-Cookie header.

string
toCookieHeader()

Formats a Cookie header for the current cookie.

setName($name)

No description

getName()

No description

setValue($value)

No description

getValue()

No description

setAttributes(array $attributes)

No description

setAttribute($name, $value)

No description

getAttributes()

No description

getAttribute($name)

No description

hasAttribute($name)

No description

clearAttributes()

No description

setCreatedAt($createdAt)

No description

getCreatedAt()

No description

Details

at line 27
__construct()

Constructor.

at line 37
bool matchesRequest(RequestInterface $request)

Returns true if the current cookie matches the supplied request

Parameters

RequestInterface $request

Return Value

bool

at line 64
boolean isExpired()

Returns true of the current cookie has expired.

Checks the max-age and expires attributes.

Return Value

boolean Whether the current cookie has expired

at line 86
boolean matchesDomain(string $domain)

Returns true if the current cookie matches the supplied domain.

Parameters

string $domain A domain hostname

Return Value

boolean

at line 106
boolean matchesPath(string $path)

Returns true if the current cookie matches the supplied path.

Parameters

string $path A path

Return Value

boolean

at line 119
fromSetCookieHeader(string $header, string $issuingDomain)

Populates the current cookie with data from the supplied Set-Cookie header.

Parameters

string $header A Set-Cookie header
string $issuingDomain The domain that issued the header

at line 151
string toCookieHeader()

Formats a Cookie header for the current cookie.

Return Value

string An HTTP request Cookie header

at line 156
setName($name)

Parameters

$name

at line 161
getName()

at line 166
setValue($value)

Parameters

$value

at line 171
getValue()

at line 176
setAttributes(array $attributes)

Parameters

array $attributes

at line 182
setAttribute($name, $value)

Parameters

$name
$value

at line 187
getAttributes()

at line 192
getAttribute($name)

Parameters

$name

at line 201
hasAttribute($name)

Parameters

$name

at line 206
clearAttributes()

at line 211
setCreatedAt($createdAt)

Parameters

$createdAt

at line 216
getCreatedAt()