public static function fromArray(array $cookies, $domain)
    {
        $cookieJar = new self();
        foreach ($cookies as $name => $value) {
            $cookieJar->setCookie(new SetCookie([
                'Domain'  => $domain,
                'Name'    => $name,
                'Value'   => $value,
                'Discard' => true
            ]));
        }

        return $cookieJar;
    }
public static function fromArray(array $cookies, $domain)
    {
        $cookieJar = new self();
        foreach ($cookies as $name => $value) {
            $cookieJar->setCookie(new SetCookie([
                'Domain'  => $domain,
                'Name'    => $name,
                'Value'   => $value,
                'Discard' => true
            ]));
        }

        return $cookieJar;
    }
public static function fromArray ( array $ cookies , $ domain ) { $ cookieJar = new self ( ) ; foreach ( $ cookies as $ name => $ value ) { $ cookieJar -> setCookie ( new SetCookie ( [ 'Domain' => $ domain , 'Name' => $ name , 'Value' => $ value , 'Discard' => true ] ) ) ; } return $ cookieJar ; }
Create a new Cookie jar from an associative array and domain.

@param array  $cookies Cookies to create the jar from
@param string $domain  Domain to set the cookies to

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