Open Journal Systems  3.3.0
GuzzleHttp\Cookie\CookieJarInterface Interface Reference
Inheritance diagram for GuzzleHttp\Cookie\CookieJarInterface:
GuzzleHttp\Cookie\CookieJar GuzzleHttp\Cookie\FileCookieJar GuzzleHttp\Cookie\SessionCookieJar

Public Member Functions

 clear ($domain=null, $path=null, $name=null)
 
 clearSessionCookies ()
 
 extractCookies (RequestInterface $request, ResponseInterface $response)
 
 setCookie (SetCookie $cookie)
 
 toArray ()
 
 withCookieHeader (RequestInterface $request)
 

Detailed Description

Stores HTTP cookies.

It extracts cookies from HTTP requests, and returns them in HTTP responses. CookieJarInterface instances automatically expire contained cookies when necessary. Subclasses are also responsible for storing and retrieving cookies from a file, database, etc.

Inspiration

Definition at line 17 of file vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php.

Member Function Documentation

◆ clear()

GuzzleHttp\Cookie\CookieJarInterface::clear (   $domain = null,
  $path = null,
  $name = null 
)

Remove cookies currently held in the cookie jar.

Invoking this method without arguments will empty the whole cookie jar. If given a $domain argument only cookies belonging to that domain will be removed. If given a $domain and $path argument, cookies belonging to the specified path within that domain are removed. If given all three arguments, then the cookie with the specified name, path and domain is removed.

Parameters
string | null$domainClears cookies matching a domain
string | null$pathClears cookies matching a domain and path
string | null$nameClears cookies matching a domain, path, and name
Returns
CookieJarInterface

Implemented in GuzzleHttp\Cookie\CookieJar.

◆ clearSessionCookies()

GuzzleHttp\Cookie\CookieJarInterface::clearSessionCookies ( )

Discard all sessions cookies.

Removes cookies that don't have an expire field or a have a discard field set to true. To be called when the user agent shuts down according to RFC 2965.

Implemented in GuzzleHttp\Cookie\CookieJar.

◆ extractCookies()

GuzzleHttp\Cookie\CookieJarInterface::extractCookies ( RequestInterface  $request,
ResponseInterface  $response 
)

Extract cookies from an HTTP response and store them in the CookieJar.

Parameters
RequestInterface$requestRequest that was sent
ResponseInterface$responseResponse that was received

Implemented in GuzzleHttp\Cookie\CookieJar.

◆ setCookie()

GuzzleHttp\Cookie\CookieJarInterface::setCookie ( SetCookie  $cookie)

Sets a cookie in the cookie jar.

Parameters
SetCookie$cookieCookie to set.
Returns
bool Returns true on success or false on failure

Implemented in GuzzleHttp\Cookie\CookieJar.

◆ toArray()

GuzzleHttp\Cookie\CookieJarInterface::toArray ( )

Converts the cookie jar to an array.

Returns
array

Implemented in GuzzleHttp\Cookie\CookieJar.

◆ withCookieHeader()

GuzzleHttp\Cookie\CookieJarInterface::withCookieHeader ( RequestInterface  $request)

Create a request with added cookie headers.

If no matching cookies are found in the cookie jar, then no Cookie header is added to the request and the same request is returned.

Parameters
RequestInterface$requestRequest object to modify.
Returns
RequestInterface returns the modified request.

Implemented in GuzzleHttp\Cookie\CookieJar.


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