Cookie Class Reference

Inherited by MockCookie.

List of all members.

Public Member Functions

 __construct ($name, $value, $attr)
 set ($value, $attr)
 Sets a cookie.
 serializeToHttpRequest ($path, $domain)
 Serialize the cookie jar into a format useful for HTTP Request headers.

Static Public Member Functions

static validateCookieDomain ($domain, $originDomain=null)
 Return the true if the cookie is valid is valid.

Protected Member Functions

 canServeDomain ($domain)
 canServePath ($path)
 isUnExpired ()

Protected Attributes

 $name
 $value
 $expires
 $path
 $domain
 $isSessionKey = true


Detailed Description

Definition at line 472 of file HttpFunctions.php.


Constructor & Destructor Documentation

Cookie::__construct ( name,
value,
attr 
)

Definition at line 484 of file HttpFunctions.php.

References $name, and $value.


Member Function Documentation

Cookie::canServeDomain ( domain  )  [protected]

Reimplemented in MockCookie.

Definition at line 595 of file HttpFunctions.php.

References $domain.

Referenced by serializeToHttpRequest().

Cookie::canServePath ( path  )  [protected]

Reimplemented in MockCookie.

Definition at line 606 of file HttpFunctions.php.

References $path.

Referenced by serializeToHttpRequest().

Cookie::isUnExpired (  )  [protected]

Reimplemented in MockCookie.

Definition at line 613 of file HttpFunctions.php.

Referenced by serializeToHttpRequest().

Cookie::serializeToHttpRequest ( path,
domain 
)

Serialize the cookie jar into a format useful for HTTP Request headers.

Parameters:
$path string the path that will be used. Required.
$domain string the domain that will be used. Required.
Returns:
string

Definition at line 583 of file HttpFunctions.php.

References $domain, $path, canServeDomain(), canServePath(), and isUnExpired().

Cookie::set ( value,
attr 
)

Sets a cookie.

Used before a request to set up any individual cookies. Used internally after a request to parse the Set-Cookie headers.

Parameters:
$name string the name of the cookie
$value string the value of the cookie
$attr array possible key/values: expires A date string path The path this cookie is used on domain Domain this cookie is used on

Definition at line 500 of file HttpFunctions.php.

References $value.

static Cookie::validateCookieDomain ( domain,
originDomain = null 
) [static]

Return the true if the cookie is valid is valid.

Otherwise, false. The uses a method similar to IE cookie security described here: http://kuza55.blogspot.com/2008/02/understanding-cookie-security.html A better method might be to use a blacklist like http://publicsuffix.org/

Parameters:
$domain string the domain to validate
$originDomain string (optional) the domain the cookie originates from
Returns:
bool

Definition at line 532 of file HttpFunctions.php.

References $domain.

Referenced by CookieJar::parseCookieResponseHeader(), and HttpTest::testValidateCookieDomain().


Member Data Documentation

Cookie::$domain [protected]

Definition at line 477 of file HttpFunctions.php.

Referenced by canServeDomain(), serializeToHttpRequest(), and validateCookieDomain().

Cookie::$expires [protected]

Definition at line 475 of file HttpFunctions.php.

Cookie::$isSessionKey = true [protected]

Definition at line 478 of file HttpFunctions.php.

Cookie::$name [protected]

Definition at line 473 of file HttpFunctions.php.

Referenced by __construct().

Cookie::$path [protected]

Definition at line 476 of file HttpFunctions.php.

Referenced by canServePath(), and serializeToHttpRequest().

Cookie::$value [protected]

Definition at line 474 of file HttpFunctions.php.

Referenced by __construct(), and set().


The documentation for this class was generated from the following file:

Generated on Sat Apr 30 22:57:34 2011 for MediaWiki by  doxygen 1.5.9