lib/Cookie/ArrayCookieJar.php
public function get(string $domain, string $path = '', string $name = null): array {
        $this->clearExpiredCookies();

        $path = $path === "" ? "/" : $path;
        $domain = \strtolower($domain);

        $matches = [];

        foreach ($this->cookies as $cookieDomain => $domainCookies) {
            if (!$this->matchesDomain($domain, $cookieDomain)) {
                continue;
            }

            foreach ($domainCookies as $cookiePath => $pathCookies) {
                if (!$this->matchesPath($path, $cookiePath)) {
                    continue;
                }

                foreach ($pathCookies as $cookieName => $cookie) {
                    if (!isset($name) || $name === $cookieName) {
                        $matches[] = $cookie;
                    }
                }
            }
        }

        return $matches;
    }
public function get(string $domain, string $path = '', string $name = null): array {
        $this->clearExpiredCookies();

        $path = $path === "" ? "/" : $path;
        $domain = \strtolower($domain);

        $matches = [];

        foreach ($this->cookies as $cookieDomain => $domainCookies) {
            if (!$this->matchesDomain($domain, $cookieDomain)) {
                continue;
            }

            foreach ($domainCookies as $cookiePath => $pathCookies) {
                if (!$this->matchesPath($path, $cookiePath)) {
                    continue;
                }

                foreach ($pathCookies as $cookieName => $cookie) {
                    if (!isset($name) || $name === $cookieName) {
                        $matches[] = $cookie;
                    }
                }
            }
        }

        return $matches;
    }
public function get ( string $ domain , string $ path = '' , string $ name = null ) : array { $ this -> clearExpiredCookies ( ) ; $ path = $ path === "" ? "/" : $ path ; $ domain = \ strtolower ( $ domain ) ; $ matches = [ ] ; foreach ( $ this -> cookies as $ cookieDomain => $ domainCookies ) { if ( ! $ this -> matchesDomain ( $ domain , $ cookieDomain ) ) { continue ; } foreach ( $ domainCookies as $ cookiePath => $ pathCookies ) { if ( ! $ this -> matchesPath ( $ path , $ cookiePath ) ) { continue ; } foreach ( $ pathCookies as $ cookieName => $ cookie ) { if ( ! isset ( $ name ) || $ name === $ cookieName ) { $ matches [ ] = $ cookie ; } } } } return $ matches ; }
Retrieve all cookies matching the specified constraints.

@param string $domain
@param string $path
@param string $name

@return array Returns an array (possibly empty) of all cookie matches.
Retrieve all cookies matching the specified constraints .