Class SimpleCookie

Description

Cookie data holder. Cookie rules are full of pretty arbitary stuff. I have used...

http://wp.netscape.com/newsref/std/cookie_spec.html http://www.cookiecentral.com/faq/

Located in /cookies.php (line 23)


	
			
Variable Summary
 mixed $_expiry
 mixed $_host
 mixed $_is_secure
 mixed $_name
 mixed $_path
 mixed $_value
Method Summary
 SimpleCookie SimpleCookie (string $name, [string $value = false], [string $path = false], [string $expiry = false], [boolean $is_secure = false])
 void agePrematurely (integer $interval)
 string getExpiry ()
 string getHost ()
 string getName ()
 string getPath ()
 string getValue ()
 void isExpired (integer/string $now)
 boolean isSecure ()
 boolean isValidHost (string $host)
 boolean isValidPath (string $path)
 boolean setHost (string $host)
Variables
mixed $_expiry (line 28)
mixed $_host (line 24)
mixed $_is_secure (line 29)
mixed $_name (line 25)
mixed $_path (line 27)
mixed $_value (line 26)
Methods
Constructor SimpleCookie (line 39)

Constructor. Sets the stored values.

SimpleCookie SimpleCookie (string $name, [string $value = false], [string $path = false], [string $expiry = false], [boolean $is_secure = false])
  • 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.
agePrematurely (line 190)

Ages the cookie by the specified number of seconds.

  • public:
void agePrematurely (integer $interval)
  • integer $interval: In seconds.
getExpiry (line 156)

Accessor for expiry.

  • return: Expiry string.
  • access: public
string getExpiry ()
getHost (line 77)

Accessor for the truncated host to which this cookie applies.

  • return: Truncated hostname.
  • access: public
string getHost ()
getName (line 113)

Accessor for name.

  • return: Cookie key.
  • access: public
string getName ()
getPath (line 132)

Accessor for path.

  • return: Valid cookie path.
  • access: public
string getPath ()
getValue (line 123)

Accessor for value. A deleted cookie will have an empty string for this.

  • return: Cookie value.
  • access: public
string getValue ()
isExpired (line 174)

Test to see if cookie is expired against the cookie format time or timestamp.

Will give true for a session cookie.

  • access: public
void isExpired (integer/string $now)
  • 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.
isSecure (line 201)

Accessor for the secure flag.

  • return: True if cookie needs SSL.
  • access: public
boolean isSecure ()
isValidHost (line 87)

Test for a cookie being valid for a host name.

  • return: True if the cookie would be valid here.
boolean isValidHost (string $host)
  • string $host: Host to test against.
isValidPath (line 144)

Tests a path to see if the cookie applies there. The test path must be longer or equal to the cookie path.

  • return: True if cookie valid here.
  • access: public
boolean isValidPath (string $path)
  • string $path: Path to test against.
setHost (line 63)

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.

  • return: True if hostname is valid.
  • access: public
boolean setHost (string $host)
  • string $host: New hostname.

Documentation generated on Sun, 04 May 2008 09:21:23 -0500 by phpDocumentor 1.3.0