Public Member Functions | |
__construct (array &$storageArray) | |
storeCookies ($request_url, $response_headers) | |
getCookies ($request_url) | |
Protected Member Functions | |
parseCookieHeaders ($header, $defaultDomain) | |
parseCookieHeader ($line, $defaultDomain) | |
storeCookie ($cookie) | |
discardCookie ($cookie) | |
expireCookies () | |
cookieMatchesTarget ($cookie, $target) | |
Private Attributes | |
$_cookies |
This class provides access to service cookies and handles parsing of response headers to pull out cookie values.
Definition at line 36 of file CookieJar.php.
CAS_CookieJar::__construct | ( | array &$ | storageArray | ) |
Create a new cookie jar by passing it a reference to an array in which it should store cookies.
ref | array $storageArray |
Definition at line 47 of file CookieJar.php.
CAS_CookieJar::cookieMatchesTarget | ( | $ | cookie, | |
$ | target | |||
) | [protected] |
Answer true if cookie is applicable to a target.
array | $cookie An array of cookie attributes. | |
array | $target An array of URL attributes as generated by parse_url(). |
private
Definition at line 288 of file CookieJar.php.
Referenced by getCookies(), and storeCookies().
CAS_CookieJar::discardCookie | ( | $ | cookie | ) | [protected] |
Discard an existing cookie
stdClass | $cookie |
private
Definition at line 249 of file CookieJar.php.
Referenced by storeCookie().
CAS_CookieJar::expireCookies | ( | ) | [protected] |
Go through our stored cookies and remove any that are expired.
private
Definition at line 270 of file CookieJar.php.
Referenced by getCookies().
CAS_CookieJar::getCookies | ( | $ | request_url | ) |
Retrieve cookies applicable for a web service request. Cookie applicability is based on RFC 2965: http://www.ietf.org/rfc/rfc2965.txt
string | $request_url The url that the cookies will be for. |
private
Definition at line 92 of file CookieJar.php.
References cookieMatchesTarget(), and expireCookies().
CAS_CookieJar::parseCookieHeader | ( | $ | line, | |
$ | defaultDomain | |||
) | [protected] |
Parse a single cookie header line.
Based on RFC2965 http://www.ietf.org/rfc/rfc2965.txt
string | $line The header line. | |
string | $defaultDomain The domain to use if none is specified in the cookie. |
Definition at line 142 of file CookieJar.php.
References phpCAS::trace().
Referenced by parseCookieHeaders().
CAS_CookieJar::parseCookieHeaders | ( | $ | header, | |
$ | defaultDomain | |||
) | [protected] |
Parse Cookies without PECL From the comments in http://php.net/manual/en/function.http-parse-cookie.php
array | $header An array of header lines. | |
string | $defaultDomain The domain to use if none is specified in the cookie. |
Definition at line 120 of file CookieJar.php.
References parseCookieHeader(), phpCAS::traceBegin(), and phpCAS::traceEnd().
Referenced by storeCookies().
CAS_CookieJar::storeCookie | ( | $ | cookie | ) | [protected] |
Add, update, or remove a cookie.
array | $cookie A cookie array as created by parseCookieHeaders() |
private
Definition at line 233 of file CookieJar.php.
References discardCookie().
Referenced by storeCookies().
CAS_CookieJar::storeCookies | ( | $ | request_url, | |
$ | response_headers | |||
) |
Store cookies for a web service request. Cookie storage is based on RFC 2965: http://www.ietf.org/rfc/rfc2965.txt
string | $request_url The URL that generated the response headers. | |
array | $response_headers An array of the HTTP response header strings. |
private
Definition at line 62 of file CookieJar.php.
References cookieMatchesTarget(), parseCookieHeaders(), storeCookie(), and phpCAS::trace().
CAS_CookieJar::$_cookies [private] |
Definition at line 38 of file CookieJar.php.