Send all cookies to the client

@return  bool
@since   2.0.0
972109
public function send()
	{
		$result = true;

		// process the cookies in this jar
		foreach ($this->jar as $cookie)
		{
			if ( ! $cookie->send())
			{
				$result = false;
			}
		}

		// and the cookies in this jar's children
		foreach ($this->children as $cookie)
		{
			if ( ! $cookie->send())
			{
				$result = false;
			}
		}

		return $result;
	}
559613
public function sendHeaders(): self
    {
        // headers have already been sent by the developer
        if (\headers_sent()) {
            return $this;
        }

        /* RFC2616 - 14.18 says all Responses need to have a Date */
        if (!$this->header->has('Date')) {
            $this->setDate(\DateTime::createFromFormat('U', (string) \time()));
        }

        // status
        \header('HTTP/' . $this->version . ' ' . $this->status . ' ' . $this->reason, true, $this->status);

        // headers
        $headers = $this->header->all();
        $this->cookie->inject($headers);

        foreach ($this->header->all() as $name => $values) {
            $first = true;
            foreach ($values as $value) {
                \header($name . ': ' . $value, $first, $this->status);
                $first = false;
            }
        }

        return $this;
    }
803651
public function send()
    {

        // Set some defaults
        $extension = null;
        $returnImage = $this->_absoluteImagePath;

        // If the GD extension is not available
        if (!extension_loaded('gd') && (!function_exists('dl') || !dl('gd.so'))) {
            $this->_addErrorHeader(\Tollwerk\Squeezr\Exception::GD_UNAVAILABLE_MSG,
                \Tollwerk\Squeezr\Exception::GD_UNAVAILABLE);

            // If the cache directory doesn't exist or is not writable: Error
        } elseif ((!@is_dir($this->_absoluteCacheImageDir) && !@mkdir($this->_absoluteCacheImageDir, 0777,
                    true)) || !@is_writable($this->_absoluteCacheImageDir)
        ) {
            $this->_addErrorHeader(\Tollwerk\Squeezr\Exception::INVALID_TARGET_CACHE_DIRECTORY_MSG,
                \Tollwerk\Squeezr\Exception::INVALID_TARGET_CACHE_DIRECTORY);

            // If the squeezr screen cookie is not available or invalid
        } elseif (empty($_COOKIE['squeezr_screen']) || !preg_match("%^(\d+)x(\d+)\@(\d+(?:\.\d+)?)$%",
                $_COOKIE['squeezr_screen'], $squeezr)
        ) {
            $this->_addErrorHeader(\Tollwerk\Squeezr\Exception::MISSING_METRICS_COOKIE_MSG,
                \Tollwerk\Squeezr\Exception::MISSING_METRICS_COOKIE);

            // Copy & resample original image
        } else {
            $errors = array();
            $returnImage = $this->squeeze($this->_absoluteImagePath, $this->_absoluteCacheImagePath, SQUEEZR_BREAKPOINT,
                $errors);
            foreach ($errors as $errNo => $errMsg) {
                $this->_addErrorHeader(sprintf($errMsg, $this->_relativeImagePath), $errNo);
            }
        }

        // Send the image along with it's HTTP headers
        $extension = ($extension === null) ? pathinfo($returnImage, PATHINFO_EXTENSION) : $extension;
        $this->_sendFile($returnImage, 'image/'.((strtolower($extension) == 'jpg') ? 'jpeg' : strtolower($extension)),
            true);
        exit;
    }
701275
protected function getCookies() 
    {
        $headers = '';
        foreach ($this->cookies as $key => $val) {
            if ($headers) $headers .= '; ';
            $headers .= $key. '='. $val;
        }

        if ($headers) {
            $headers = "Cookie: $headers"."\r\n";
        }

        return $headers;
    }
501754
public function getCookies()
    {
        $result = array();
        foreach ($this->_cookies as $path)
        {
            foreach ($path as $cookies)
            {
                foreach ($cookies as $cookie) {
                    $result[] = $cookie;
                }
            }
        }

        return $result;
    }
894342
public function sendHeaders($cookies_also = true, $override = false)
    {
        if (headers_sent() && !$override) {
            return $this;
        }

        // Send our HTTP status line
        header($this->httpStatusLine());

        // Iterate through our Headers data collection and send each header
        foreach ($this->headers as $key => $value) {
            header($key .': '. $value, false);
        }

        if ($cookies_also) {
            $this->sendCookies($override);
        }

        return $this;
    }
993289
protected function prepareCookies()
    {
        $cookiesString = '';

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

        return $cookiesString;
    }
884020
public function csrf_set_cookie() {
		$expire = time() + $this->_csrf_expire;
		$secure_cookie = (Cfg::get('cookie.secure') === TRUE) ? 1 : 0;
		
		if ($secure_cookie) {
			$req = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : FALSE;
			
			if (!$req or $req == 'off') {
				return FALSE;
			}
		}
		
		setcookie($this->_csrf_cookie_name, $this->_csrf_hash, $expire, Cfg::get('cookie.path'), Cfg::get('cookie.domain'), $secure_cookie);
		
		//log_message('debug', "CRSF cookie Set");
		
		return $this;
	}
570593
protected function setCookie()
    {
        $cookie = openssl_encrypt(json_encode([
            'expires' => $this->getCookieDuration(),
            'hash'    => $this->getHash(),
            'ip'      => $this->ipAddress() ?? false,
            'agent'   => $this->browserAgent() ?? false
        ]), $this->cipher, $this->secret, false, $this->vector);

        return setcookie($this->cookie, $cookie, $this->getCookieDuration(), COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true);
    }
83092
public function send()
	{
		$result = true;

		if ($this->isNew)
		{
			// make this cookie as used
			$this->isNew = false;

			// set the cookie
			$result = $this->wrapper->setcookie($this->name, $this->value, $this->config['expiration'], $this->config['path'], $this->config['domain'], $this->config['secure'], $this->config['http_only']);

			// mark the cookie as sent
			if ($result)
			{
				$this->isSent = true;
			}
		}
		elseif ($this->isDeleted)
		{
			// delete the cookie by nullifying and expiring it
			$result = $this->wrapper->setcookie($this->name, null, -86400, $this->config['path'], $this->config['domain'], $this->config['secure'], $this->config['http_only']);

			// mark the cookie as sent
			if ($result)
			{
				$this->isSent = true;
			}
		}

		return $result;
	}
551893
protected static function save_session()
    {
        $saved = [];

        $user = (array) static::$user;

        foreach ($user as $key => $value) {
            if (in_array($key, static::$saved)) {
                $saved[$key] = $value;
            }
        }

        $name = static::resource('session');

        Session::put($name, $saved, config('auth.cookie_lifetime'));

        return true;
    }
414625
public function send()
    {
        /* @var $cookie \Core\Http\Cookie\CookieInterface */
        foreach ($this->cookies as $cookie) {
            setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpire(), $cookie->getPath(), $cookie->getDomain(), $cookie->getSecure(), $cookie->getHttponly());
        }
    }
289801
function send()
    {
        if (!headers_sent()) {
            extract($this->toArray());
            setcookie($name, $value, $expires, $path, $domain, $secure, $httponly);
        }
    }
1033346
public function send()
    {
        $spool = new Spool(new Config($this->config));

        if ($spool->send($this)) {
            return true;
        }

        $this->setErrors($spool->getErrors());

        return false;
    }
1154521
public function restoreLoginFromCookie()
    {
        if (! $this->cookieIsSet()) {
            return false;
        }

        $fields = $this->config('fields');
        $cookieKey = $this->config('cookieKey');
        $loginData = [];

        foreach ($fields as $field) {
            if ($this->Cookie->check("$cookieKey.$field")) {
                $loginData[$field] = $this->Cookie->read("$cookieKey.$field");
            }
        }

        // $controller->request->data might need to be copied over to $this->request->data, depending on how Auth is looking for it
        $controller = $this->_registry->getController();
        $tempRequest = $controller->request->data;
        $controller->request->data = $loginData;
        $user = $controller->Auth->identify();
        $controller->request->data = $tempRequest;

        if ($user) {
            $controller->Auth->setUser($user);
            return true;
        }

        return false;
    }
404475
public function sendHeaders()
    {
        // headers have already been sent by the developer
        if (headers_sent()) {
            return $this;
        }

        // headers
        foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
            $replace = 0 === strcasecmp($name, 'Content-Type');
            foreach ($values as $value) {
                header($name.': '.$value, $replace, $this->statusCode);
            }
        }

        // cookies
        foreach ($this->headers->getCookies() as $cookie) {
            header('Set-Cookie: '.$cookie->getName().strstr($cookie, '='), false, $this->statusCode);
        }

        // status
        header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);

        return $this;
    }
1000558
public function acceptCookies()
    {
        $this->response = $this->response->withCookie((new Cookie('cookies-policy', true))->withNeverExpire());

        return $this->redirect($this->referer(['_name' => 'homepage'], true));
    }