Cookie holder object

package Requests
subpackage Cookies

 Methods

Create a new jar

__construct(array $cookies = array()

Parameters

$cookies

array

Existing cookie values

Parse all cookies from a response and attach them to the response

before_redirect_check(\Requests_Response $return) 
var

Parameters

$return

Add Cookie header to a request if we have any

before_request(string $url, array $headers, array $data, string $type, array $options) 

As per RFC 6265, cookies are separated by '; '

Parameters

$url

string

$headers

array

$data

array

$type

string

$options

array

Get an iterator for the data

getIterator() : \ArrayIterator

Returns

\ArrayIterator

Normalise cookie data into a Requests_Cookie

normalizeCookie($cookie, $key = null) : \Requests_Cookie
codeCoverageIgnore
deprecated Use {@see Requests_Cookie_Jar::normalize_cookie}

Parameters

$cookie

$key

Returns

\Requests_Cookie

Check if the given item exists

offsetExists(string $key) : boolean

Parameters

$key

string

Item key

Returns

booleanDoes the item exist?

Get the value for the item

offsetGet(string $key) : string

Parameters

$key

string

Item key

Returns

stringItem value

Set the given item

offsetSet(string $key, string $value) 

Parameters

$key

string

Item name

$value

string

Item value

Exceptions

\Requests_Exception On attempting to use dictionary as list (`invalidset`)

Unset the given header

offsetUnset(string $key) 

Parameters

$key

string

Register the cookie handler with the request's hooking system

register(\Requests_Hooker $hooks) 

Parameters

$hooks

\Requests_Hooker

Hooking system

 Properties

 

Actual item data

$cookies : array

Default

array()