|
MediaWiki
REL1_19
|
Public Member Functions | |
| __construct ($name, $value, $attr) | |
| serializeToHttpRequest ($path, $domain) | |
| Serialize the cookie jar into a format useful for HTTP Request headers. | |
| set ($value, $attr) | |
| Sets a cookie. | |
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 | |
| $domain | |
| $expires | |
| $isSessionKey = true | |
| $name | |
| $path | |
| $value | |
Definition at line 6 of file Cookie.php.
| Cookie::__construct | ( | $ | name, |
| $ | value, | ||
| $ | attr | ||
| ) |
Definition at line 18 of file Cookie.php.
| Cookie::canServeDomain | ( | $ | domain | ) | [protected] |
| $domain |
Definition at line 146 of file Cookie.php.
References $domain.
Referenced by serializeToHttpRequest().

| Cookie::canServePath | ( | $ | path | ) | [protected] |
| $path |
Definition at line 162 of file Cookie.php.
References $path.
Referenced by serializeToHttpRequest().

| Cookie::isUnExpired | ( | ) | [protected] |
Definition at line 169 of file Cookie.php.
Referenced by serializeToHttpRequest().

| Cookie::serializeToHttpRequest | ( | $ | path, |
| $ | domain | ||
| ) |
Serialize the cookie jar into a format useful for HTTP Request headers.
| $path | String: the path that will be used. Required. |
| $domain | String: the domain that will be used. Required. |
Definition at line 130 of file Cookie.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.
| $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 34 of file Cookie.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/
fails to detect 3-letter top-level domains fails to detect 2-letter top-level domains for single-domain use (probably not a big problem in practice, but there are test cases)
| $domain | String: the domain to validate |
| $originDomain | String: (optional) the domain the cookie originates from |
Definition at line 72 of file Cookie.php.
References $domain.
Referenced by CookieJar\parseCookieResponseHeader(), and HttpTest\testValidateCookieDomain().

Cookie::$domain [protected] |
Definition at line 11 of file Cookie.php.
Referenced by canServeDomain(), serializeToHttpRequest(), and validateCookieDomain().
Cookie::$expires [protected] |
Definition at line 9 of file Cookie.php.
Cookie::$isSessionKey = true [protected] |
Definition at line 12 of file Cookie.php.
Cookie::$name [protected] |
Definition at line 7 of file Cookie.php.
Referenced by __construct().
Cookie::$path [protected] |
Definition at line 10 of file Cookie.php.
Referenced by canServePath(), and serializeToHttpRequest().
Cookie::$value [protected] |
Definition at line 8 of file Cookie.php.
Referenced by __construct(), and set().