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 |
Definition at line 472 of file HttpFunctions.php.
Cookie::__construct | ( | $ | name, | |
$ | value, | |||
$ | attr | |||
) |
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.
$path | string the path that will be used. Required. | |
$domain | string the domain that will be used. Required. |
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.
$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/
$domain | string the domain to validate | |
$originDomain | string (optional) the domain the cookie originates from |
Definition at line 532 of file HttpFunctions.php.
References $domain.
Referenced by CookieJar::parseCookieResponseHeader(), and HttpTest::testValidateCookieDomain().
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] |
Cookie::$path [protected] |
Definition at line 476 of file HttpFunctions.php.
Referenced by canServePath(), and serializeToHttpRequest().
Cookie::$value [protected] |