Class SimpleCookieJar

Description

Repository for cookies. This stuff is a tiny bit browser dependent.

Located in /cookies.php (line 228)


	
			
Variable Summary
 mixed $_cookies
Method Summary
 SimpleCookieJar SimpleCookieJar ()
 void agePrematurely (integer $interval)
 string getCookieValue (string $host, string $path, string $name)
 void restartSession ([ $date = false], string/integer $now)
 array selectAsPairs (SimpleUrl $url)
 void setCookie (string $name, string $value, [string $host = false], [string $path = '/'], [string $expiry = false])
Variables
mixed $_cookies (line 229)
Methods
Constructor SimpleCookieJar (line 235)

Constructor. Jar starts empty.

  • access: public
SimpleCookieJar SimpleCookieJar ()
agePrematurely (line 270)

Ages all cookies in the cookie jar.

  • access: public
void agePrematurely (integer $interval)
  • integer $interval: The old session is moved into the past by this number of seconds. Cookies now over age will be removed.
getCookieValue (line 326)

Reads the most specific cookie value from the browser cookies. Looks for the longest path that matches.

  • return: False if not present, else the value as a string.
  • access: public
string getCookieValue (string $host, string $path, string $name)
  • string $host: Host to search.
  • string $path: Applicable path.
  • string $name: Name of cookie to read.
restartSession (line 245)

Removes expired and temporary cookies as if the browser was closed and re-opened.

  • access: public
void restartSession ([ $date = false], string/integer $now)
  • string/integer $now: Time to test expiry against.
  • $date
selectAsPairs (line 370)

Uses a URL to sift relevant cookies by host and path. Results are list of strings of form "name=value".

  • return: Valid name and value pairs.
  • access: public
array selectAsPairs (SimpleUrl $url)
setCookie (line 286)

Sets an additional cookie. If a cookie has the same name and path it is replaced.

  • access: public
void setCookie (string $name, string $value, [string $host = false], [string $path = '/'], [string $expiry = false])
  • string $name: Cookie key.
  • string $value: Value of cookie.
  • string $host: Host upon which the cookie is valid.
  • string $path: Cookie path if not host wide.
  • string $expiry: Expiry date.

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