class CookieJar
CookieJar.
Methods
|
set(Cookie $cookie)
Sets a cookie. |
||
| Cookie|null |
get(string $name, string $path = '/', string $domain = null)
Gets a cookie by name. |
|
|
expire(string $name, string $path = '/', string $domain = null)
Removes a cookie by name. |
||
|
clear()
Removes all the cookies from the jar. |
||
|
updateFromSetCookie(array $setCookies, string $uri = null)
Updates the cookie jar from a response Set-Cookie headers. |
||
|
updateFromResponse(Response $response, string $uri = null)
Updates the cookie jar from a Response object. |
||
| Cookie[] |
all()
Returns not yet expired cookies. |
|
| array |
allValues(string $uri, Boolean $returnsRawValue = false)
Returns not yet expired cookie values for the given URI. |
|
| array |
allRawValues(string $uri)
Returns not yet expired raw cookie values for the given URI. |
|
|
flushExpiredCookies()
Removes all expired cookies. |
Details
at line 32
public
set(Cookie $cookie)
Sets a cookie.
at line 53
public Cookie|null
get(string $name, string $path = '/', string $domain = null)
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).
at line 84
public
expire(string $name, string $path = '/', string $domain = null)
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).
at line 116
public
clear()
Removes all the cookies from the jar.
at line 127
public
updateFromSetCookie(array $setCookies, string $uri = null)
Updates the cookie jar from a response Set-Cookie headers.
at line 156
public
updateFromResponse(Response $response, string $uri = null)
Updates the cookie jar from a Response object.
at line 166
public Cookie[]
all()
Returns not yet expired cookies.
at line 190
public array
allValues(string $uri, Boolean $returnsRawValue = false)
Returns not yet expired cookie values for the given URI.
at line 229
public array
allRawValues(string $uri)
Returns not yet expired raw cookie values for the given URI.
at line 237
public
flushExpiredCookies()
Removes all expired cookies.