addCookie()
addCookiesFromResponse()
count()
fromArray()
fromResponse()
fromString()
get()
getAllCookies()
getCookie()
getIterator()
getMatchingCookies()
isEmpty()
offsetExists()
offsetGet()
offsetSet()
offsetUnset()
reset()
serialize()
set()
toArray()
toString()
unserialize()
_flattenCookiesArray()
_matchDomain()
_matchPath()
$cookies
$rawCookies
COOKIE_OBJECT
COOKIE_STRING_ARRAY
COOKIE_STRING_CONCAT
A Cookies object is designed to contain and maintain HTTP cookies, and should be used along with Zend_Http_Client in order to manage cookies across HTTP requests and responses.
The class contains an array of Zend\Http\Header\Cookie objects. Cookies can be added automatically from a request or manually. Then, the Cookies class can find and return the cookies needed for a specific HTTP request.
A special parameter can be passed to all methods of this class that return cookies: Cookies can be returned either in their native form (as Zend\Http\Header\Cookie objects) or as strings - the later is suitable for sending as the value of the "Cookie" header in an HTTP request. You can also choose, when returning more than one cookie, whether to get an array of strings (by passing Zend\Http\Client\Cookies::COOKIE_STRING_ARRAY) or one unified string for all cookies (by passing Zend\Http\Client\Cookies::COOKIE_STRING_CONCAT).
| link | for some specs. |
|---|
addCookie(\Zend\Http\Header\SetCookie | string $cookie, \Zend\Uri\Uri | string $refUri)
Cookie should be passed either as a Zend\Http\Header\Cookie object or as a string - in which case an object is created from the string.
\Zend\Http\Header\SetCookiestring
\Zend\Http\Client\Exception\InvalidArgumentException |
if invalid $cookie value |
|---|
addCookiesFromResponse(\Zend\Http\Response $response, \Zend\Uri\Uri | string $refUri)
count() : int
intfromArray(array $values)
fromResponse(\Zend\Http\Response $response, $refUri) : \Zend\Http\Client\Cookies
If $uri is set, it will be considered as the requested URI for setting default domain and path of the cookie.
| todo | Add the $uri functionality. |
|---|
fromString($string)
get($name, $default)
getAllCookies(int $retAs) : array | string
intWhether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
arraystring
getCookie(\Zend\Uri\Uri | string $uri, string $cookieName, int $retAs) : \Zend\Http\Client\Cookie | string
stringThe cookie's name
intWhether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
\Zend\Http\Client\Exception\InvalidArgumentException |
if invalid URI specified or invalid $retAs value |
|---|
\Zend\Http\Client\Cookiestring
getMatchingCookies(string | \Zend\Uri\Uri $uri, bool $matchSessionCookies, int $retAs, int $now) : array | string
boolWhether to send session cookies
intWhether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
intOverride the current time when checking for expiry time
\Zend\Http\Client\Exception\InvalidArgumentException |
if invalid URI |
|---|
arraystring
isEmpty() : bool
booloffsetExists(mixed $offset) : bool
| link | http://php.net/manual/en/arrayaccess.offsetexists.php |
|---|
mixedAn offset to check for.
boolReturns true on success or false on failure. The return value will be casted to boolean if non-boolean was returned.
offsetGet(mixed $offset) : mixed
| link | http://php.net/manual/en/arrayaccess.offsetget.php |
|---|
mixedThe offset to retrieve.
mixedCan return all value types.offsetSet(mixed $offset, mixed $value) : void
| link | http://php.net/manual/en/arrayaccess.offsetset.php |
|---|
mixedThe offset to assign the value to.
mixedThe value to set.
offsetUnset(mixed $offset) : void
| link | http://php.net/manual/en/arrayaccess.offsetunset.php |
|---|
mixedThe offset to unset.
serialize() : string
| link | http://php.net/manual/en/serializable.serialize.php |
|---|
stringthe string representation of the object or &null;set($name, $value)
toArray()
toString()
unserialize(string $serialized) : mixed
| link | http://php.net/manual/en/serializable.unserialize.php |
|---|
stringThe string representation of the object.
mixedthe original value unserialized._flattenCookiesArray(\Zend\Http\Header\Cookie | array $ptr, int $retAs) : array | string
Should be used when exporting the cookies array (or parts of it)
\Zend\Http\Header\Cookiearray
intWhat value to return
arraystring
_matchDomain(string $domain) : array
string
array_matchPath(array $domains, string $path) : array
array
string
array$rawCookies : array
COOKIE_OBJECT
COOKIE_STRING_ARRAY
COOKIE_STRING_CONCAT