MediaWiki
1.28.3
|
Public Member Functions | |
__construct ($name, $value, $attr) | |
serializeToHttpRequest ($path, $domain) | |
Serialize the cookie jar into a format useful for HTTP Request headers. More... | |
set ($value, $attr) | |
Sets a cookie. More... | |
Static Public Member Functions | |
static | validateCookieDomain ($domain, $originDomain=null) |
Return the true if the cookie is valid is valid. More... | |
Protected Member Functions | |
canServeDomain ($domain) | |
canServePath ($path) | |
isUnExpired () | |
Protected Attributes | |
$domain | |
$expires | |
$isSessionKey = true | |
$name | |
$path | |
$value | |
Definition at line 24 of file Cookie.php.
Cookie::__construct | ( | $name, | |
$value, | |||
$attr | |||
) |
|
protected |
string | $domain |
Definition at line 175 of file Cookie.php.
References $domain.
Referenced by serializeToHttpRequest().
|
protected |
string | $path |
Definition at line 198 of file Cookie.php.
References $path.
Referenced by serializeToHttpRequest().
|
protected |
Cookie::serializeToHttpRequest | ( | $path, | |
$domain | |||
) |
Serialize the cookie jar into a format useful for HTTP Request headers.
string | $path | The path that will be used. Required. |
string | $domain | The domain that will be used. Required. |
Definition at line 159 of file Cookie.php.
References $domain, $path, $ret, $value, canServeDomain(), canServePath(), isUnExpired(), and name.
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.
string | $value | The value of the cookie |
array | $attr | Possible key/values: expires A date string path The path this cookie is used on domain Domain this cookie is used on |
InvalidArgumentException |
Definition at line 53 of file Cookie.php.
References $value.
Referenced by __construct().
|
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/
fixme fails to detect 3-letter top-level domains
fixme fails to detect 2-letter top-level domains for single-domain use (probably not a big problem in practice, but there are test cases)
string | $domain | The domain to validate |
string | $originDomain | (optional) the domain the cookie originates from |
Definition at line 92 of file Cookie.php.
References $domain.
Referenced by CookieJar\parseCookieResponseHeader(), and HttpTest\testValidateCookieDomain().
|
protected |
Definition at line 29 of file Cookie.php.
Referenced by canServeDomain(), serializeToHttpRequest(), and validateCookieDomain().
|
protected |
Definition at line 27 of file Cookie.php.
|
protected |
Definition at line 30 of file Cookie.php.
|
protected |
Definition at line 25 of file Cookie.php.
Referenced by __construct().
|
protected |
Definition at line 28 of file Cookie.php.
Referenced by canServePath(), and serializeToHttpRequest().
|
protected |
Definition at line 26 of file Cookie.php.
Referenced by __construct(), serializeToHttpRequest(), and set().