Get all cookies in the cookie jar as an array

@param  int $ret_as Whether to return cookies as objects of Zend_Http_Cookie or as strings
@return array|string
336372
public function getAllCookies($ret_as = self::COOKIE_OBJECT)
    {
        $cookies = $this->_flattenCookiesArray($this->cookies, $ret_as);
        return $cookies;
    }
993289
protected function prepareCookies()
    {
        $cookiesString = '';

        foreach ($this->cookies as $cookie => $value) {
            $cookiesString .= $cookie.'='.$value.'; ';
        }

        return $cookiesString;
    }
1267779
protected function obtainCookies(array &$options, $base_uri = null)
    {
        $client = new Client();

        $loginOptions = [
            'debug' => isset($options['debug']) && $options['debug'] ? true : false,
            'allow_redirects' => false,
            'cookies' => $this->coockieJar
        ];

        if (!is_null($base_uri)) {
            $loginOptions['base_uri'] = $base_uri;
        }

        $method = 'GET';
        if ($this->config['method'] === 'POST') {
            $loginOptions['form_params'] = $this->config['fields'];
            $method                      = 'POST';
        } else if ($this->config['method'] === 'JSON') {
            $loginOptions['body']                    = json_encode($this->config['fields']);
            $loginOptions['headers']['Content-Type'] = 'application/json';
            $method                                  = 'POST';
        } else if ($this->config['method'] === 'GET') {
            $loginOptions['query'] = !is_array($this->config['fields']) ? (array) $this->config['fields']
                    : $this->config['fields'];
        }

        if (isset($options['auth-cookie']['onBeforeLogin'])) {
            $closer       = $options['auth-cookie']['onBeforeLogin'];
            $loginOptions = $closer($loginOptions);
            if (false === $loginOptions) {
                return;
            }
        }

        $client->request($method, $this->config['uri'], $loginOptions);

        $this->loginMade = true;
    }
1063532
private static function get_cookie_settings($type) {
	$name      = self::get_cookie_name($type);
	$duration  = self::$type_durations[$type];
	$domain    = $_SERVER['SERVER_NAME'];
	$path      = '/';
	$secure    = !empty($_SERVER['HTTPS']) ? true : false;
	$http_only = true;
	
	return [
		'name'      => $name,
		'duration'  => $duration,
		'domain'    => $domain,
		'path'      => $path,
		'secure'    => $secure,
		'http_only' => $http_only,
	];
}
500355
public function cookies($request)
    {
        $headers = $response->headers();
        if (!isset($headers['Set-Cookie'])) {
            return [];
        }
        $setCookies = [];
        foreach ($headers['Set-Cookie'] as $setCookieHeader) {
            $setCookie = Cookie::fromString($setCookieHeader);
            if (!$setCookie->domain()) {
                $setCookie->domain($request->hostname());
            }
            if (strpos($setCookie->path(), '/') !== 0) {
                $setCookie->path($this->_pathFrom($request));
            }
            $setCookies[] = $setCookie;
        }
        return $setCookies;
    }
952260
public function asArray()
    {
        $cookies = [];
        foreach (array_filter($this->storage) as $cookie) {
            $cookies[] = 'Set-Cookie: ' . (string) $cookie;
        }

        return $cookies;
    }
855686
protected function getRequestCookies()
    {
        $pairs = array();

        foreach ($this->cookies as $k => $v) {
            $pairs[] = "$k=$v";
        }

        return join($pairs, ';');
    }
30210
public function getAll()
    {
        $out = [];
        foreach ($this->cookies as $cookie) {
            $out[] = $this->convertCookieToArray($cookie);
        }

        return $out;
    }
887436
public function cookies(array $cookies = null): HttpRequest
    {
        if ($cookies === null) {
            $cookies = $_COOKIE;
        }
        foreach ($cookies as $name => $value) {
            $this->cookie($name, $value);
        }

        return $this;
    }
618604
public function elements( $as_text = true )
    {
        $elements = array_slice( $this->URIArray, $this->Index );
        if ( $as_text )
        {
            $retValue = implode( '/', $elements );
            return $retValue;
        }
        else
            return $elements;
    }
1332730
public function all()
    {
        $this->flushExpiredCookies();

        $flattenedCookies = array();
        foreach ($this->cookieJar as $path) {
            foreach ($path as $cookies) {
                foreach ($cookies as $cookie) {
                    $flattenedCookies[] = $cookie;
                }
            }
        }

        return $flattenedCookies;
    }
1218024
public function getValues() {

        $cookies = [];

        try {

            foreach ( $this->cookies as $name => $cookie ) {

                $cookies[$name] = $cookie->getValue();

            }

        } catch (CookieException $ce) {

            throw $ce;

        }

        return $cookies;

    }
280954
public final function cookies(array $cookies = null): array
    {
        return ($cookies == null) ? $this->getCookies() : $this->getCookies($cookies);
    }
306860
public function offsetGet($name)
    {
        $data = [];
        if (!isset($this->_hashes[$name])) {
            throw new RuntimeException("Unexisting Set-Cookie `'{$name}'`.");
        }
        foreach ($this->_hashes[$name] as $key => $hash) {
            $data[] = $this->_data[$hash];
        }
        return $data;
    }
1195145
@Override
    public Cookie[] getCookies() {
        List<HttpCookie> cookies = this.request.getCookies();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getCookies: " + cookies.size());
        }
        if (cookies.isEmpty()) {
            return null;
        }
        Cookie[] output = new Cookie[cookies.size()];
        int i = 0;
        for (HttpCookie cookie : cookies) {
            output[i++] = new Cookie(cookie.getName(), cookie.getValue());
        }
        return output;
    }
1025380
function get_cookies(url) {
	debug.assert(url).is('object');
	debug.assert(url.host).is('string');

	if(!is.array(_cookies[url.host])) {
		//debug.log('No cookies for host ', url.host);
		return undefined;
	}

	var cookies = ARRAY(_cookies[url.host]).map(function(cookie) {
		var i = cookie.indexOf(';');
		return cookie.substr(0, ((i >= 1) ? i : cookie.length));
	}).valueOf();

	//debug.log('Cookies found (for host ', url.host ,'): ', cookies);

	return cookies;
}
1057447
protected function getMetadataCookie() {
    $cookie_name = $this->getMetadataCookieName();
    if (!array_key_exists($cookie_name, $_COOKIE)) {
      return array();
    }

    // The cookie value can be wrapped in "-characters so remove them
    $cookie_value = trim($_COOKIE[$cookie_name], '"');

    if (empty($cookie_value)) {
      return array();
    }

    $parts = explode('&', $cookie_value);
    $metadata = array();
    foreach ($parts as $part) {
      $pair = explode('=', $part, 2);
      if (!empty($pair[0])) {
        $metadata[urldecode($pair[0])] =
          (count($pair) > 1) ? urldecode($pair[1]) : '';
      }
    }

    return $metadata;
  }