PHP WebSocket2 Library
PHP5 Library for browsing web
|
HTTP cookie manager. More...
Public Member Functions | |
addCookie (HttpCookie $cookie) | |
Adds new cookie. More... | |
filterCookies (callable $filter_func) | |
Performs cookie enumeration and filtering. More... | |
cleanupCookies ($current_time) | |
Performs cookie cleanup. Removes all expired cookies. More... | |
getAllCookies () | |
Returns all cookies. More... | |
removeAllCookies () | |
Removes all cookies. | |
getCookies (WebRequest $request) | |
Adds all cookies that match specified request to that request. More... | |
Data Fields | |
const | FILTER_NEXT = 0 |
Cookie filtering mode: go to next cookie. | |
const | FILTER_ABORT = 1 |
Cookie filtering mode: abort cookie enumeration. | |
const | FILTER_REMOVE_COOKIE_NEXT = 2 |
Cookie filtering mode: remove current cookie and go to next one. | |
const | FILTER_REMOVE_COOKIE_ABORT = 3 |
Cookie filtering mode: remove current cookie and abort cookie enumeration. | |
HTTP cookie manager.
addCookie | ( | HttpCookie | $cookie | ) |
Adds new cookie.
HttpCookie | $cookie | Cookie to add |
cleanupCookies | ( | $current_time | ) |
Performs cookie cleanup. Removes all expired cookies.
mixed | $current_time | Can be null, which means session end. Can be int (current UNIX timestamp) |
filterCookies | ( | callable | $filter_func | ) |
Performs cookie enumeration and filtering.
Filtering function must have the following prototype:
Where cookie is current HttpCookie object.
Return value must be one of FILTER_NEXT, FILTER_ABORT, FILTER_REMOVE_COOKIE_NEXT and FILTER_REMOVE_COOKIE_ABORT.
callable | $filter_func | Cookie filtering function |
getAllCookies | ( | ) |
Returns all cookies.
Array | Cookies array (value is HttpCookie, key is index) |
getCookies | ( | WebRequest | $request | ) |
Adds all cookies that match specified request to that request.
Exactly, adds Set-Cookie headers to request.
WebRequest | $request | HTTP request |