Methods |
public
|
set(Cookie $cookie)
|
#
|
public
|
get(string $name, string $path = '/', ?string $domain = null): Cookie|null
Gets a cookie by name.
Gets a cookie by name.
You should never use an empty domain, but if you do so,
this method returns the first cookie for the given name/path
(this behavior ensures a BC behavior with previous versions of
Symfony).
|
#
|
public
|
expire(string $name, ?string $path = '/', ?string $domain = null)
Removes a cookie by name.
Removes a cookie by name.
You should never use an empty domain, but if you do so,
all cookies for the given name/path expire (this behavior
ensures a BC behavior with previous versions of Symfony).
|
#
|
public
|
clear()
Removes all the cookies from the jar.
Removes all the cookies from the jar.
|
#
|
public
|
updateFromSetCookie(string[] $setCookies, ?string $uri = null)
Updates the cookie jar from a response Set-Cookie headers.
Updates the cookie jar from a response Set-Cookie headers.
Parameters
$setCookies |
Set-Cookie headers from an HTTP response
|
|
#
|
public
|
updateFromResponse(Response $response, ?string $uri = null)
Updates the cookie jar from a Response object.
Updates the cookie jar from a Response object.
|
#
|
public
|
all(): Cookie[]
Returns not yet expired cookies.
Returns not yet expired cookies.
|
#
|
public
|
allValues(string $uri, bool $returnsRawValue = false): array
Returns not yet expired cookie values for the given URI.
Returns not yet expired cookie values for the given URI.
|
#
|
public
|
allRawValues(string $uri): array
Returns not yet expired raw cookie values for the given URI.
Returns not yet expired raw cookie values for the given URI.
|
#
|
public
|
flushExpiredCookies()
Removes all expired cookies.
Removes all expired cookies.
|
#
|