Moodle  2.2.1
http://www.collinsharper.com
Zend_Http_Cookie Class Reference

Public Member Functions

 __construct ($name, $value, $domain, $expires=null, $path=null, $secure=false)
 getName ()
 getValue ()
 getDomain ()
 getPath ()
 getExpiryTime ()
 isSecure ()
 isExpired ($now=null)
 isSessionCookie ()
 match ($uri, $matchSessionCookies=true, $now=null)
 __toString ()

Static Public Member Functions

static fromString ($cookieStr, $refUri=null, $encodeValue=true)
static matchCookieDomain ($cookieDomain, $host)
static matchCookiePath ($cookiePath, $path)

Protected Attributes

 $name
 $value
 $expires
 $domain
 $path
 $secure
 $encodeValue

Detailed Description

Definition at line 47 of file Cookie.php.


Constructor & Destructor Documentation

__construct ( name,
value,
domain,
expires = null,
path = null,
secure = false 
)

Cookie object constructor

Todo:
Add validation of each one of the parameters (legal domain, etc.)
Parameters:
string$name
string$value
string$domain
int$expires
string$path
bool$secure

Definition at line 110 of file Cookie.php.


Member Function Documentation

Get the cookie as a string, suitable for sending as a "Cookie" header in an HTTP request

Returns:
string

Definition at line 266 of file Cookie.php.

static fromString ( cookieStr,
refUri = null,
encodeValue = true 
) [static]

Generate a new Cookie object from a cookie string (for example the value of the Set-Cookie HTTP header)

Parameters:
string$cookieStr
Zend_Uri_Http | string$refUriReference URI for default values (domain, path)
boolean$encodeValueWeither or not the cookie's value should be passed through urlencode/urldecode
Returns:
Zend_Http_Cookie A new Zend_Http_Cookie object or false on failure.

The expiration is past Tue, 19 Jan 2038 03:14:07 UTC the maximum for 32-bit signed integer. Zend_Date can get around that limit.

See also:
Zend_Date

Definition at line 284 of file Cookie.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getDomain ( )

Get cookie domain

Returns:
string

Definition at line 158 of file Cookie.php.

Here is the caller graph for this function:

Get the expiry time of the cookie, or null if no expiry time is set

Returns:
int|null

Definition at line 178 of file Cookie.php.

getName ( )

Get Cookie name

Returns:
string

Definition at line 138 of file Cookie.php.

getPath ( )

Get the cookie path

Returns:
string

Definition at line 168 of file Cookie.php.

Here is the caller graph for this function:

getValue ( )

Get cookie value

Returns:
string

Definition at line 148 of file Cookie.php.

isExpired ( now = null)

Check whether the cookie has expired

Always returns false if the cookie is a session cookie (has no expiry time)

Parameters:
int$nowTimestamp to consider as "now"
Returns:
boolean

Definition at line 201 of file Cookie.php.

Here is the caller graph for this function:

isSecure ( )

Check whether the cookie should only be sent over secure connections

Returns:
boolean

Definition at line 188 of file Cookie.php.

Check whether the cookie is a session cookie (has no expiry time set)

Returns:
boolean

Definition at line 216 of file Cookie.php.

Here is the caller graph for this function:

match ( uri,
matchSessionCookies = true,
now = null 
)

Checks whether the cookie should be sent or not in a specific scenario

Parameters:
string | Zend_Uri_Http$uriURI to check against (secure, domain, path)
boolean$matchSessionCookiesWhether to send session cookies
int$nowOverride the current time when checking for expiry time
Returns:
boolean

Definition at line 229 of file Cookie.php.

Here is the call graph for this function:

static matchCookieDomain ( cookieDomain,
host 
) [static]

Check if a cookie's domain matches a host name.

Used by Zend_Http_Cookie and Zend_Http_CookieJar for cookie matching

Parameters:
string$cookieDomain
string$host
Returns:
boolean

Definition at line 377 of file Cookie.php.

Here is the caller graph for this function:

static matchCookiePath ( cookiePath,
path 
) [static]

Check if a cookie's path matches a URL path

Used by Zend_Http_Cookie and Zend_Http_CookieJar for cookie matching

Parameters:
string$cookiePath
string$path
Returns:
boolean

Definition at line 410 of file Cookie.php.

Here is the caller graph for this function:


Field Documentation

$domain [protected]

Definition at line 75 of file Cookie.php.

$encodeValue [protected]

Definition at line 96 of file Cookie.php.

$expires [protected]

Definition at line 68 of file Cookie.php.

$name [protected]

Definition at line 54 of file Cookie.php.

$path [protected]

Definition at line 82 of file Cookie.php.

$secure [protected]

Definition at line 89 of file Cookie.php.

$value [protected]

Definition at line 61 of file Cookie.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations