Methods |
public
static
|
fromCookieHeaders(string[] $headers, bool $raw = false): static
Creates a CookieStore from an array of `Set-Cookie` headers.
Creates a CookieStore from an array of Set-Cookie headers.
Throws
|
#
|
final
public
|
__construct(Cookie[] $cookies)
|
#
|
public
|
has(string $name, string $prefix = '', ?string $value = null): bool
Checks if a `Cookie` object identified by name and
prefix is present in the collection.
Checks if a Cookie object identified by name and
prefix is present in the collection.
|
#
|
public
|
get(string $name, string $prefix = ''): Cookie
Retrieves an instance of `Cookie` identified by a name and prefix.
This throws an exception if not found.
Retrieves an instance of Cookie identified by a name and prefix.
This throws an exception if not found.
Throws
|
#
|
public
|
put(Cookie $cookie): static
Store a new cookie and return a new collection. The original collection
is left unchanged.
Store a new cookie and return a new collection. The original collection
is left unchanged.
|
#
|
public
|
remove(string $name, string $prefix = ''): static
Removes a cookie from a collection and returns an updated collection.
The original collection is left unchanged.
Removes a cookie from a collection and returns an updated collection.
The original collection is left unchanged.
Removing a cookie from the store DOES NOT delete it from the browser.
If you intend to delete a cookie from the browser, you must put an empty
value cookie with the same name to the store.
|
#
|
public
|
dispatch(): void
Dispatches all cookies in store.
Dispatches all cookies in store.
Deprecated
Response should dispatch cookies.
|
#
|
public
|
display(): array<string, Cookie>
Returns all cookie instances in store.
Returns all cookie instances in store.
|
#
|
public
|
clear(): void
Clears the cookie collection.
Clears the cookie collection.
|
#
|
public
|
count(): int
Gets the Cookie count in this collection.
Gets the Cookie count in this collection.
Implements
|
#
|
public
|
getIterator(): Traversable<string, Cookie>
Gets the iterator for the cookie collection.
Gets the iterator for the cookie collection.
Implements
|
#
|
protected
|
validateCookies(array $cookies): void
Validates all cookies passed to be instances of Cookie.
Validates all cookies passed to be instances of Cookie.
Throws
|
#
|
protected
|
setRawCookie(string $name, string $value, array $options): void
Extracted call to `setrawcookie()` in order to run unit tests on it.
Extracted call to setrawcookie() in order to run unit tests on it.
|
#
|
protected
|
setCookie(string $name, string $value, array $options): void
Extracted call to `setcookie()` in order to run unit tests on it.
Extracted call to setcookie() in order to run unit tests on it.
|
#
|