You are here

public function CookieJar::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php \GuzzleHttp\Cookie\CookieJar::__construct()

Parameters

bool $strictMode Set to true to throw exceptions when invalid: cookies are added to the cookie jar.

array $cookieArray Array of SetCookie objects or a hash of: arrays that can be used with the SetCookie constructor

2 methods override CookieJar::__construct()
FileCookieJar::__construct in vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
Create a new FileCookieJar object
SessionCookieJar::__construct in vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
Create a new SessionCookieJar object

File

vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php, line 25

Class

CookieJar
Cookie jar that stores cookies an an array

Namespace

GuzzleHttp\Cookie

Code

public function __construct($strictMode = false, $cookieArray = []) {
  $this->strictMode = $strictMode;
  foreach ($cookieArray as $cookie) {
    if (!$cookie instanceof SetCookie) {
      $cookie = new SetCookie($cookie);
    }
    $this
      ->setCookie($cookie);
  }
}