ArrayCookieJar
    
            
            in package
            
        
    
            
            implements
                            CookieJarInterface,                             Serializable                    
    
    
Cookie cookieJar that stores cookies an an array
Table of Contents
Interfaces
- CookieJarInterface
- Interface for persisting cookies
- Serializable
Properties
- $cookies : array<string|int, mixed>
- $strictMode : bool
Methods
- __construct() : mixed
- add() : bool
- Add a cookie to the cookie cookieJar
- addCookiesFromResponse() : mixed
- Add cookies from a {@see Guzzle\Http\Message\Response} object
- all() : array<string|int, mixed>
- Get all of the matching cookies
- count() : int
- Returns the total number of stored cookies
- getIterator() : ArrayIterator
- Returns an iterator
- getMatchingCookies() : array<string|int, mixed>
- Get cookies matching a request object
- remove() : CookieJarInterface
- Remove cookies currently held in the Cookie cookieJar.
- removeExpired() : CookieJarInterface
- Delete any expired cookies
- removeTemporary() : CookieJarInterface
- Discard all temporary cookies.
- serialize() : string
- Serializes the cookie cookieJar
- setStrictMode() : self
- Enable or disable strict mode on the cookie jar
- unserialize() : mixed
- Unserializes the cookie cookieJar
- removeCookieIfEmpty() : mixed
- If a cookie already exists and the server asks to set it again with a null value, the cookie must be deleted.
Properties
$cookies
    protected
        array<string|int, mixed>
    $cookies
     = array()
    
        Loaded cookie data
$strictMode
    protected
        bool
    $strictMode
    
    
        Whether or not strict mode is enabled. When enabled, exceptions will be thrown for invalid cookies
Methods
__construct()
    public
                    __construct([bool $strictMode = false ]) : mixed
    Parameters
- $strictMode : bool = false
- 
                    Set to true to throw exceptions when invalid cookies are added to the cookie jar 
add()
Add a cookie to the cookie cookieJar
    public
                    add(Cookie $cookie) : bool
    Parameters
- $cookie : Cookie
- 
                    Cookie to add 
Return values
bool —Returns true on success or false on failure
addCookiesFromResponse()
Add cookies from a {@see Guzzle\Http\Message\Response} object
    public
                    addCookiesFromResponse(Response $response[, RequestInterface $request = null ]) : mixed
    Parameters
- $response : Response
- 
                    Response object 
- $request : RequestInterface = null
- 
                    Request that received the response 
all()
Get all of the matching cookies
    public
                    all([mixed $domain = null ][, mixed $path = null ][, mixed $name = null ][, mixed $skipDiscardable = false ][, mixed $skipExpired = true ]) : array<string|int, mixed>
    Parameters
- $domain : mixed = null
- 
                    Domain of the cookie 
- $path : mixed = null
- 
                    Path of the cookie 
- $name : mixed = null
- 
                    Name of the cookie 
- $skipDiscardable : mixed = false
- 
                    Set to TRUE to skip cookies with the Discard attribute. 
- $skipExpired : mixed = true
- 
                    Set to FALSE to include expired 
Return values
array<string|int, mixed> —Returns an array of Cookie objects
count()
Returns the total number of stored cookies
    public
                    count() : int
    Return values
intgetIterator()
Returns an iterator
    public
                    getIterator() : ArrayIterator
    Return values
ArrayIteratorgetMatchingCookies()
Get cookies matching a request object
    public
                    getMatchingCookies(RequestInterface $request) : array<string|int, mixed>
    Parameters
- $request : RequestInterface
- 
                    Request object to match 
Return values
array<string|int, mixed>remove()
Remove cookies currently held in the Cookie cookieJar.
    public
                    remove([mixed $domain = null ][, mixed $path = null ][, mixed $name = null ]) : CookieJarInterface
    Invoking this method without arguments will empty the whole Cookie cookieJar. If given a $domain argument only cookies belonging to that domain will be removed. If given a $domain and $path argument, cookies belonging to the specified path within that domain are removed. If given all three arguments, then the cookie with the specified name, path and domain is removed.
Parameters
- $domain : mixed = null
- 
                    Set to clear only cookies matching a domain 
- $path : mixed = null
- 
                    Set to clear only cookies matching a domain and path 
- $name : mixed = null
- 
                    Set to clear only cookies matching a domain, path, and name 
Return values
CookieJarInterfaceremoveExpired()
Delete any expired cookies
    public
                    removeExpired() : CookieJarInterface
    Return values
CookieJarInterfaceremoveTemporary()
Discard all temporary cookies.
    public
                    removeTemporary() : CookieJarInterface
    Scans for all cookies in the cookieJar with either no expire field or a true discard flag. To be called when the user agent shuts down according to RFC 2965.
Return values
CookieJarInterfaceserialize()
Serializes the cookie cookieJar
    public
                    serialize() : string
    Return values
stringsetStrictMode()
Enable or disable strict mode on the cookie jar
    public
                    setStrictMode(bool $strictMode) : self
    Parameters
- $strictMode : bool
- 
                    Set to true to throw exceptions when invalid cookies are added. False to ignore them. 
Return values
selfunserialize()
Unserializes the cookie cookieJar
    public
                    unserialize(mixed $data) : mixed
    Parameters
- $data : mixed
removeCookieIfEmpty()
If a cookie already exists and the server asks to set it again with a null value, the cookie must be deleted.
    private
                    removeCookieIfEmpty(Cookie $cookie) : mixed
    Parameters
- $cookie : Cookie