Return cookie value

@param string $name    cookie name
@param mixed  $default value if not set

@return mixed
776419
public static function get($name, $default = array())
	{
		$debug = \bdk\Debug::getInstance();
		$debug->groupCollapsed(__METHOD__, $name);
		if (!isset($_COOKIE[$name])) {
			$debug->groupEnd();
			return $default;
		}
		$value = $_COOKIE[$name];
		if (is_array($value)) {
			$debug->groupEnd();
			return $value;
		}
		if ($value == 'deleted') {
			unset($_COOKIE[$name]);
			$debug->groupEnd();
			return $default;
		}
		/*
		$tempValue = $value;
		if (Str::isBase64Encoded($value)) {
			$debug->log('testing base64 decoded for serialized data');
			$tempValue = base64_decode($value);
		}
		$debug->log('tempValue', $tempValue);
		*/
		$hashJsonRegex = '/^(?:([0-9a-f]{32}):)?((\{.+\})|(\[.+\]))$/';
		if (preg_match($hashJsonRegex, $value, $matches)) {
			// appears to be a json'd array (hash optional)
			$hash = $matches[1];
			$jsonStr = $matches[2];
			// $debug->log('jsonStr', $jsonStr);
			if (self::$cfgStatic['hashKey']) {
				// should be hashed
				$hashComputed = md5(self::$cfgStatic['hashKey'].$jsonStr);
				if (!$hash || $hash !== $hashComputed) {
					// hash missing or invalid -> reject
					$debug->warn('invalid hash');
					$jsonStr = null;
					$value = null;
				}
			}
			if ($jsonStr) {
				$value = json_decode($jsonStr, true);
			}
		}
		$_COOKIE[$name] = $value;
		$debug->log(
			'returning cookieValue',
			is_string($value)
				? substr($value, 0, 80).'...'
				: $value
		);
		$debug->groupEnd();
		return $value;
	}
102248
public function get(string $name, $default = null)
    {
        $all = $this->all();

        if (! array_key_exists($name, $all)) {
            return $default;
        }

        return $all[$name];
    }
6803
public static function getF($name, $filter = array(), $default = false)
	{
		if (isset($_COOKIE[$name]))
		{
			return execFilter($_COOKIE[$name], $filter);
		}
		else
		{
			return $default;
		}
	}
756650
public function cookie($name = null, $default = null, $type = null)
    {
        $cookie = $this->request['cookie'];
        gplcart_array_trim($cookie, true);

        if (isset($name)) {
            $return = isset($cookie[$name]) ? $cookie[$name] : $default;
        } else {
            $return = $cookie;
        }

        gplcart_settype($return, $type, $default);
        return $return;
    }
563425
public function header($name, $default = null)
    {
        $header = $this->headers[strtolower($name)] ?? null;

        return $header ? $header->value() : $default;
    }
150559
public function getCookie($key, $default = null) {
		return isset($this->cookie[$key]) ? $this->cookie[$key] : $default;
	}
262294
public function get($name, $default = null)
    {
        $responseCookie = $this->responseCookies->getCookieByName($name);
        if ($responseCookie !== null) {
            return $responseCookie->getValue();
        }
        if (in_array($name, $this->responseCookies->getClearedCookies(), true)) {
            return $default;
        }

        return $this->getRequest()->cookies->get($name, $default);
    }
968612
public function getCookie($name)
    {

        $filter = $default = '';

        $cookie = $this->getVar($name, $filter, $default, "cookies");

        //@TODO cookie before return
        return empty($cookie) ? false : $cookie;
    }
567945
public function get($name = null, $default = null)
    {
        $context = $this->_context;

        if (!$context->started) {
            $this->_start();
        }

        if ($name === null) {
            return $context->_SESSION;
        } elseif (isset($context->_SESSION[$name])) {
            return $context->_SESSION[$name];
        } else {
            return $default;
        }
    }
261046
public function getCookie($key, $default = null)
    {
        return isset($this->cookies[$key]) ? $this->cookies[$key]['value'] : $default;
    }
642210
public function getVar($name, $default = null)
    {
        if (array_key_exists($name, $this->vars)) {
            return $this->vars[$name];
        }

        return $default;
    }
1297561
public function get($name, $default = null)
    {
        $parsed = explode('.', $name);

        $result = $_SESSION;

        while ($parsed) {
            $next = array_shift($parsed);

            if (isset($result[$next])) {
                $result = $result[$next];
            } else {
                return $default;
            }
        }

        return $result;
    }
1346135
public function getSettingValue($name, $default = false)
    {
        $settingValue = $this->manager->getCachedValue($name);

        if ($settingValue) {
            return $settingValue;
        }

        return $default;
    }
939622
public static function getVar($name,$default,$vartype=''){
		switch($vartype){
			case 'post':
				return self::getVarPost($name,$default);
			case 'get':
				return self::getVarGet($name,$default);
			case 'cookie':
				return self::getVarCookie($name,$default);
				}
		$v=self::getVarGet($name,NULL);
		if($v===NULL){
			$v=self::getVarPost($name,NULL);
			}
		if(($v===NULL)||($v===false)){
			return $default;
			}
		return $v;
		}
349939
public function getValue($name, $default = null)
    {
        $value = array_key_exists($name, $this->config) ? $this->config[$name] : $default;

        if ($value && ($value instanceof \Closure)) {
            $value = $value();
        }

        return $value;
    }
152084
public function get($name, $default = null)
	{
		if (is_null($name))
		{
			return $this->data;
		}
		return \Arr::get($this->data, $name, $default);
	}
1256634
public function getValue($name, $default = null)
    {
        return isset($this->data[$name]) ? $this->data[$name] : $default;
    }