MediaWiki  1.33.0
CookieJar Class Reference

Cookie jar to use with MWHttpRequest. More...

Collaboration diagram for CookieJar:

Public Member Functions

 parseCookieResponseHeader ( $cookie, $domain)
 Parse the content of an Set-Cookie HTTP Response header. More...
 
 serializeToHttpRequest ( $path, $domain)
 
 setCookie ( $name, $value, $attr)
 Set a cookie in the cookie jar. More...
 

Private Attributes

Cookie[] $cookie = []
 

Detailed Description

Cookie jar to use with MWHttpRequest.

Does not handle cookie unsetting.

Definition at line 25 of file CookieJar.php.

Member Function Documentation

◆ parseCookieResponseHeader()

CookieJar::parseCookieResponseHeader (   $cookie,
  $domain 
)

Parse the content of an Set-Cookie HTTP Response header.

Parameters
string$cookie
string$domainCookie's domain
Returns
null

Definition at line 76 of file CookieJar.php.

References $cookie, $name, $value, as, captcha-old\count, list, setCookie(), and Cookie\validateCookieDomain().

◆ serializeToHttpRequest()

CookieJar::serializeToHttpRequest (   $path,
  $domain 
)
See also
Cookie::serializeToHttpRequest
Parameters
string$path
string$domain
Returns
string

Definition at line 55 of file CookieJar.php.

References $path, $serialized, and as.

◆ setCookie()

CookieJar::setCookie (   $name,
  $value,
  $attr 
)

Set a cookie in the cookie jar.

Make sure only one cookie per-name exists.

See also
Cookie::set()
Parameters
string$name
string$value
array$attr

Definition at line 36 of file CookieJar.php.

References $name, and $value.

Referenced by parseCookieResponseHeader(), and MWHttpRequest\setCookie().

Member Data Documentation

◆ $cookie

Cookie [] CookieJar::$cookie = []
private

Definition at line 27 of file CookieJar.php.

Referenced by parseCookieResponseHeader().


The documentation for this class was generated from the following file: