[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/Requests/ -> Cookie.php (summary)

Cookie storage object

File Size: 505 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Requests_Cookie:: (15 methods):
  __construct()
  is_expired()
  uri_matches()
  domain_matches()
  path_matches()
  normalize()
  normalize_attribute()
  format_for_header()
  formatForHeader()
  format_for_set_cookie()
  formatForSetCookie()
  __toString()
  parse()
  parse_from_headers()
  parseFromHeaders()


Class: Requests_Cookie  - X-Ref

Cookie storage object

__construct($name, $value, $attributes = array()   X-Ref
Create a new cookie object

param: string $name
param: string $value
param: array|Requests_Utility_CaseInsensitiveDictionary $attributes Associative array of attribute data

is_expired()   X-Ref
Check if a cookie is expired.

Checks the age against $this->reference_time to determine if the cookie
is expired.

return: boolean True if expired, false if time is valid.

uri_matches(Requests_IRI $uri)   X-Ref
Check if a cookie is valid for a given URI

param: Requests_IRI $uri URI to check
return: boolean Whether the cookie is valid for the given URI

domain_matches($string)   X-Ref
Check if a cookie is valid for a given domain

param: string $string Domain to check
return: boolean Whether the cookie is valid for the given domain

path_matches($request_path)   X-Ref
Check if a cookie is valid for a given path

From the path-match check in RFC 6265 section 5.1.4

param: string $request_path Path to check
return: boolean Whether the cookie is valid for the given path

normalize()   X-Ref
Normalize cookie and attributes

return: boolean Whether the cookie was successfully normalized

normalize_attribute($name, $value)   X-Ref
Parse an individual cookie attribute

Handles parsing individual attributes from the cookie values.

param: string $name Attribute name
param: string|boolean $value Attribute value (string value, or true if empty/flag)
return: mixed Value if available, or null if the attribute value is invalid (and should be skipped)

format_for_header()   X-Ref
Format a cookie for a Cookie header

This is used when sending cookies to a server.

return: string Cookie formatted for Cookie header

formatForHeader()   X-Ref
Format a cookie for a Cookie header

return: string

format_for_set_cookie()   X-Ref
Format a cookie for a Set-Cookie header

This is used when sending cookies to clients. This isn't really
applicable to client-side usage, but might be handy for debugging.

return: string Cookie formatted for Set-Cookie header

formatForSetCookie()   X-Ref
Format a cookie for a Set-Cookie header

return: string

__toString()   X-Ref
Get the cookie value

Attributes and other data can be accessed via methods.

parse($string, $name = '', $reference_time = null)   X-Ref
Parse a cookie string into a cookie object

Based on Mozilla's parsing code in Firefox and related projects, which
is an intentional deviation from RFC 2109 and RFC 2616. RFC 6265
specifies some of this handling, but not in a thorough manner.

param: string Cookie header value (from a Set-Cookie header)
return: Requests_Cookie Parsed cookie object

parse_from_headers(Requests_Response_Headers $headers, Requests_IRI $origin = null, $time = null)   X-Ref
Parse all Set-Cookie headers from request headers

param: Requests_Response_Headers $headers Headers to parse from
param: Requests_IRI|null $origin URI for comparing cookie origins
param: int|null $time Reference time for expiration calculation
return: array

parseFromHeaders(Requests_Response_Headers $headers)   X-Ref
Parse all Set-Cookie headers from request headers

return: array



Generated : Thu Dec 15 08:20:01 2022 Cross-referenced by PHPXref