|
Moodle
2.2.1
http://www.collinsharper.com
|
Public Member Functions | |
| SimpleCookie ($name, $value=false, $path=false, $expiry=false, $is_secure=false) | |
| setHost ($host) | |
| getHost () | |
| isValidHost ($host) | |
| _truncateHost ($host) | |
| getName () | |
| getValue () | |
| getPath () | |
| isValidPath ($path) | |
| getExpiry () | |
| isExpired ($now) | |
| agePrematurely ($interval) | |
| isSecure () | |
| _fixPath ($path) | |
Data Fields | |
| $_host | |
| $_name | |
| $_value | |
| $_path | |
| $_expiry | |
| $_is_secure | |
Definition at line 23 of file cookies.php.
| _fixPath | ( | $ | path | ) |
Adds a trailing and leading slash to the path if missing.
| string | $path | Path to fix. private |
Definition at line 211 of file cookies.php.

| _truncateHost | ( | $ | host | ) |
Extracts just the domain part that determines a cookie's host validity.
| string | $host | Host name to truncate. |
Definition at line 98 of file cookies.php.


| agePrematurely | ( | $ | interval | ) |
Ages the cookie by the specified number of seconds.
| integer | $interval | In seconds. |
Definition at line 190 of file cookies.php.
| getExpiry | ( | ) |
Accessor for expiry.
Definition at line 156 of file cookies.php.
| getHost | ( | ) |
Accessor for the truncated host to which this cookie applies.
Definition at line 77 of file cookies.php.

| getName | ( | ) |
| getPath | ( | ) |
Accessor for path.
Definition at line 132 of file cookies.php.

| getValue | ( | ) |
Accessor for value. A deleted cookie will have an empty string for this.
Definition at line 123 of file cookies.php.
| isExpired | ( | $ | now | ) |
Test to see if cookie is expired against the cookie format time or timestamp. Will give true for a session cookie.
| integer/string | $now Time to test against. Result will be false if this time is later than the cookie expiry. Can be either a timestamp integer or a cookie format date. public |
Definition at line 174 of file cookies.php.
| isSecure | ( | ) |
Accessor for the secure flag.
Definition at line 201 of file cookies.php.
| isValidHost | ( | $ | host | ) |
Test for a cookie being valid for a host name.
| string | $host | Host to test against. |
Definition at line 87 of file cookies.php.

| isValidPath | ( | $ | path | ) |
Tests a path to see if the cookie applies there. The test path must be longer or equal to the cookie path.
| string | $path | Path to test against. |
Definition at line 144 of file cookies.php.

| setHost | ( | $ | host | ) |
Sets the host. The cookie rules determine that the first two parts are taken for certain TLDs and three for others. If the new host does not match these rules then the call will fail.
| string | $host | New hostname. |
Definition at line 63 of file cookies.php.

| SimpleCookie | ( | $ | name, |
| $ | value = false, |
||
| $ | path = false, |
||
| $ | expiry = false, |
||
| $ | is_secure = false |
||
| ) |
Constructor. Sets the stored values.
| string | $name | Cookie key. |
| string | $value | Value of cookie. |
| string | $path | Cookie path if not host wide. |
| string | $expiry | Expiry date as string. |
| boolean | $is_secure | Currently ignored. |
Definition at line 39 of file cookies.php.

| $_expiry |
Definition at line 28 of file cookies.php.
| $_host |
Definition at line 24 of file cookies.php.
| $_is_secure |
Definition at line 29 of file cookies.php.
| $_name |
Definition at line 25 of file cookies.php.
| $_path |
Definition at line 27 of file cookies.php.
| $_value |
Definition at line 26 of file cookies.php.