@param     $cookiedomain
@param     $cookiepath
@param int $expires
@param int $secure
@param int $httponly

@return array
480523
public function setCookies($cookiedomain, $cookiepath, $expires=0, $secure=0, $httponly=1)
	{
		$cookies = $this->parsecookies($this->cookies);
		foreach ($cookies as $cookie) {
			$name = '';
			$value = '';
			if ($expires == 0) {
				$expires_time = 0;
			} else {
				$expires_time = time()+$expires;
			}
			if (isset($cookie['value']['key'])) {
				$name = $cookie['value']['key'];
			}
			if (isset($cookie['value']['value'])) {
				$value = $cookie['value']['value'];
			}
			if (isset($cookie['expires'])) {
				$expires_time = $cookie['expires'];
			}
			if (!$cookiepath) {
				if (isset($cookie['path'])) {
					$cookiepath = $cookie['path'];
				}
			}
			if (!$cookiedomain) {
				if (isset($cookie['domain'])) {
					$cookiedomain = $cookie['domain'];
				}
			}
			$this->status['debug'][] = $this->addCookie($name, urldecode($value), $expires_time, $cookiepath, $cookiedomain, $secure, $httponly);
			if ($name == 'MOODLEID_') {
				$this->status['cURL']['moodle'] = urldecode($value);
			}
		}
		return $this->status;
	}
274817
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;
    }
515208
public function setCookieParams($lifetime, $path=NULL, $domain=NULL, $secure=FALSE, $httponly= FALSE){
        session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly);
    }
36378
public function getAndDelete($name, $path = '/', $domain = '', $secure = false, $http_only = false) {
        $value = $this->get($name);
        $this->delete($name, $path, $domain, $secure, $http_only);

        return $value;
    }
417978
public function setCookie($key, $value = null, $expire = null, $path = null, $domain = null, $secure = null, $httpOnly = null) {
        $this->response->setCookie($key, $value, $expire, $path, $domain, $secure, $httpOnly);
        return $this;
    }
104757
public static function parse($cookieHeader) {
		if (empty($cookieHeader)) {
			return null;
		}

		if (\preg_match('/^' . self::HEADER_PREFIX . '(.*?)=(.*?)(?:; (.*?))?$/i', $cookieHeader, $matches)) {
			$cookie = new self($matches[1]);
			$cookie->setPath(null);
			$cookie->setHttpOnly(false);
			$cookie->setValue(
				\urldecode($matches[2])
			);
			$cookie->setSameSiteRestriction(null);

			if (\count($matches) >= 4) {
				$attributes = \explode('; ', $matches[3]);

				foreach ($attributes as $attribute) {
					if (\strcasecmp($attribute, 'HttpOnly') === 0) {
						$cookie->setHttpOnly(true);
					}
					elseif (\strcasecmp($attribute, 'Secure') === 0) {
						$cookie->setSecureOnly(true);
					}
					elseif (\stripos($attribute, 'Expires=') === 0) {
						$cookie->setExpiryTime((int) \strtotime(\substr($attribute, 8)));
					}
					elseif (\stripos($attribute, 'Domain=') === 0) {
						$cookie->setDomain(\substr($attribute, 7));
					}
					elseif (\stripos($attribute, 'Path=') === 0) {
						$cookie->setPath(\substr($attribute, 5));
					}
					elseif (\stripos($attribute, 'SameSite=') === 0) {
						$cookie->setSameSiteRestriction(\substr($attribute, 9));
					}
				}
			}

			return $cookie;
		}
		else {
			return null;
		}
	}
1057558
public function set(
        $name = '',
        $value = '',
        $expire = 0,
        $path = '/',
        $domain = '',
        $secure = false,
        $httpOnly = false
    ) {
        if (empty($value)) {
            Craft::$app->response->cookies->remove($name);
        } else {
            $domain = empty($domain) ? Craft::$app->getConfig()->getGeneral()->defaultCookieDomain : $domain;
            $expire = (int)$expire;
            setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
            $_COOKIE[$name] = $value;
        }
    }
589816
public void setCookie(String name, String value, String path, Date expirationDate, boolean secure, boolean httpOnly) {
        if (remote == null)
            throw new IllegalStateException("Cannot setCookie since remote == null");
        if (path == null || path.length() == 0)
            path = remote.getPath();
        Cookie.Builder builder = new Cookie.Builder();
        builder.name(name).value(value).domain(remote.getHost()).path(path);
        if (expirationDate != null)
            builder.expiresAt(expirationDate.getTime());
        List<Cookie> cookies = Collections.singletonList(builder.build());
        this.clientFactory.addCookies(cookies);
    }
928933
public function setCookie($value, $lifetime, $path = null, $domain = null, $secure = null, $httpOnly = null)
	{
		// Default parameters
		if ( ! isset($path))     $path     = $this->defaults['path'];
		if ( ! isset($domain))   $domain   = $this->defaults['domain'];
		if ( ! isset($secure))   $secure   = $this->defaults['secure'];
		if ( ! isset($httpOnly)) $httpOnly = $this->defaults['http_only'];

		setcookie($this->getKey(), json_encode($value), $lifetime, $path, $domain, $secure, $httpOnly);
	}
1294172
private static function serializePHPCookies(string $cookieName, $cookieValue): string
    {
        $cookieParts = [];
        $urlEncodedCookieName = urlencode($cookieName);
        $valueType = gettype($cookieValue);
        switch ($valueType) {
            case 'integer':
            case 'double':
            case 'string':
                $urlEncodedCookieValue = urlencode((string) $cookieValue);
                $cookieParts[] = "$urlEncodedCookieName=$urlEncodedCookieValue";
                break;

            case 'array':
                foreach ($cookieValue as $cookieValueKey => $cookieValueValue) {
                    $cookieParts[] = self::serializePHPCookies($cookieName."[$cookieValueKey]", $cookieValueValue);
                }
                break;

            case 'NULL':
                $cookieParts[] = "$urlEncodedCookieName=";
                break;

            case 'boolean':
                $cookieParts[] = "$urlEncodedCookieName=".((bool) $cookieValue ? '1' : '0');
                break;

            // It's a security risk to serialize an object and send it as a cookie
            case 'object':
                // Intentional fallthrough
            default:
                $cookieParts[] = "$urlEncodedCookieName=".self::UNSUPPORTED_TYPE_VALUE;
                break;
        }

        return implode(';', $cookieParts);
    }
876664
public function setSecureCookie(
        $name = "",
        $value = "",
        $expire = 0,
        $path = "/",
        $domain = "",
        $secure = false,
        $httpOnly = false
    ) {
        Cookies::$plugin->cookies->setSecure(
            $name,
            $value,
            $expire,
            $path,
            $domain,
            $secure,
            $httpOnly
        );
    }
1033256
public function make( $name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true )
	{
		list( $path, $domain, $secure ) = $this->getPathAndDomain( $path, $domain, $secure );
		$time = ( $minutes == 0 ) ? 0 : time() + ( $minutes * 60 );

		return new Cookie( $name, $value, $time, $path, $domain, $secure, $httpOnly );
	}
1217222
function getCookieOptions() {
    let cookieOpt = {
      httpOnly: true
    };
    if (opt.cookieDomain) {
      cookieOpt.domain = opt.cookieDomain;
    }
    if (opt.secure) {
      cookieOpt.secure = true;
    }
    if (opt.cookiePath) {
      cookieOpt.path = opt.cookiePath;
    }
    return cookieOpt;
  }
1348750
protected function setCookie($value, $lifetime, $path = null, $domain = null, $secure = null, $httpOnly = null)
    {
        setcookie(
            $this->options['name'],
            json_encode($value),
            $lifetime,
            $path ?: $this->options['path'],
            $domain ?: $this->options['domain'],
            $secure ?: $this->options['secure'],
            $httpOnly ?: $this->options['http_only']
        );
    }
1123661
public function delete($name, $path = '/', $domain = '', $secure = false, $http_only = false) {
        $success = $this->set($name, null, -10, $path, $domain, $secure, $http_only);
        $this->_deleted_cookies[$name] = $name;

        if (isset($this->_cookies[$name])) {
            unset($this->_cookies[$name]);
        }

        return $success;
    }
763924
static public function setCookie($name, $value, $expire='3600', $path='', $domain='', $secure=false)
    {
        $prefix = $this->options['group'] ? $this->options['group'] . '_' : 'WS_';
        if ($name) $name =  $prefix . $name;
        HttpHelper::setCookie($name, $value, $expire, $path, $domain, $secure);
    }
1250163
public function delete($name, $path = null, $domain = null, $secure = false, $httpOnly = true)
    {
        $this->response->deleteCookie($name, $path, $domain, $secure, $httpOnly);

        return $this;
    }