Copied!

Cookie jar that stores cookies as an array

CloneableInstantiableIterable
Methods
public __construct(bool $strictMode = false, array $cookieArray = [])
 
public clear(?string $domain = NULL, ?string $path = NULL, ?string $name = NULL) : void
 
  • inheritDoc
public clearSessionCookies() : void
 
  • inheritDoc
public count() : int
public extractCookies(Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response) : void
public static fromArray(array $cookies, string $domain) : self
 

Create a new Cookie jar from an associative array and domain.

public getCookieByName(string $name) : ?GuzzleHttp\Cookie\SetCookie
 

Finds and returns the cookie based on the name

public getIterator() : ArrayIterator
public setCookie(GuzzleHttp\Cookie\SetCookie $cookie) : bool
 
  • inheritDoc
public static shouldPersist(GuzzleHttp\Cookie\SetCookie $cookie, bool $allowSessionCookies = false) : bool
 

Evaluate if this cookie should be persisted to storage
that survives between requests.

public toArray() : array
 
  • inheritDoc
public withCookieHeader(Psr\Http\Message\RequestInterface $request) : Psr\Http\Message\RequestInterface
Properties
private $cookies
 
private $strictMode
Methods
private getCookiePathFromRequest(Psr\Http\Message\RequestInterface $request) : string
 

Computes cookie path following RFC 6265 section 5.1.4

private removeCookieIfEmpty(GuzzleHttp\Cookie\SetCookie $cookie) : void
 

If a cookie already exists and the server asks to set it again with a
null value, the cookie must be deleted.

Methods
public static fromArray(array $cookies, string $domain) : self
 

Create a new Cookie jar from an associative array and domain.

public static shouldPersist(GuzzleHttp\Cookie\SetCookie $cookie, bool $allowSessionCookies = false) : bool
 

Evaluate if this cookie should be persisted to storage
that survives between requests.

© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration