Class SimpleCookieJar

Description

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

Located in /libraries/pear/simpletest/user_agent.php (line 25)


	
			
Variable Summary
 mixed $_cookies
Method Summary
 SimpleCookieJar SimpleCookieJar ()
 void addHeaders (SimpleHttpRequest &$request, SimpleUrl $url)
 void agePrematurely (integer $interval)
 hash getValidCookies ([string $host = false], [string $path = "/"])
 void restartSession ([mixed $date = false], string/integer $now)
 void setCookie (SimpleCookie $cookie)
 boolean _isMatch (SimpleTest $cookie, string $host, string $path, string $name)
Variables
mixed $_cookies (line 26)
Methods
Constructor SimpleCookieJar (line 32)

Constructor. Jar starts empty.

  • access: public
SimpleCookieJar SimpleCookieJar ()
addHeaders (line 146)

Adds the current cookies to a request.

  • access: private
void addHeaders (SimpleHttpRequest &$request, SimpleUrl $url)
agePrematurely (line 67)

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.
getValidCookies (line 106)

Fetches a hash of all valid cookies filtered

by host, path and keyed by name Any cookies with missing categories will not be filtered out by that category. Expired cookies must be cleared by restarting the session.

  • return: Valid cookie objects keyed on the cookie name.
  • access: public
hash getValidCookies ([string $host = false], [string $path = "/"])
  • string $host: Host name requirement.
  • string $path: Path encompassing cookies.
restartSession (line 42)

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

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

Adds a cookie to the jar. This will overwrite cookies with matching host, paths and keys.

  • access: public
void setCookie (SimpleCookie $cookie)
_isMatch (line 127)

Tests cookie for matching against search criteria.

  • return: True if matched.
  • access: private
boolean _isMatch (SimpleTest $cookie, string $host, string $path, string $name)
  • SimpleTest $cookie: Cookie to test.
  • string $host: Host must match.
  • string $path: Cookie path must be shorter than this path.
  • string $name: Name must match.

Documentation generated on Fri, 10 Dec 2004 18:26:52 +0000 by phpDocumentor 1.3.0RC3