setSiteCookie()
@return bool true if OK else false
186699
public function setSiteCookie($cookie, $value, $expire, $path="/") {
    // bool setcookie ( string $name [, string $value [, int $expire = 0
    // [, string $path [, string $domain [, bool $secure = false
    // [, bool $httponly = false ]]]]]] )

    $ref = $this->siteDomain;

    if(!setcookie($cookie, $value, $expire, $path, $ref)) {
      return false;
    }
    return true;
  }
535829
public function setSite($site)
  {
    if ($site === '?' || $site === '') {
      $this->site = null;
    } elseif (strlen(preg_replace('/[^a-zA-Z]/', '', $site) < 2)) {
      // Some sites have been non-letter gibberish.
      $this->site = null;
    } else {
      $site = Util::foreignLettersToEnglishLetters($site);
      $site = Util::titleCaseIfCurrentlyAllCaps($site);
      $this->site = $site;
    }
  }
1012901
private function setCookie()
    {
        setcookie(
            $this->cookieName,
            $this->sessionId,
            ($this->expireOnClose) ? 0 : $this->now + $this->secondsUntilExpiration,
            '/',
            null,
            $this->secureCookie,
            true
        );
    }
840670
protected function setRememberMeCookie(): void
	{
		if($this->options['cookie_options']['secure'] && !$this->request->isSecure())
		{
			throw new RuntimeException('Attempted to set a secure cookie over a non-secure connection.');
		}

		$this->response->getCookies()->addSigned($this->options['auth_key'], $this->user->getAccessToken(), (3600 * 24 * 365), $this->options['cookie_options']);
	}
1138111
protected function isAllowed()
    {
        if ($this->verifyCookie() || $this->allowAdmins() || $this->allowUsers() || $this->allowedIpAddress()) {
            return true;
        }

        return false;
    }
1373314
protected function loadFromCookie()
    {
        if ($this->cookieLanguageField && ($language = Yii::$app->request->cookies->has($this->cookieLanguageField))) {
            return $language;
        }

        return false;
    }
1052580
public function setSite($site){
        if(!$this->setModified('site', $site)->isModified()){
            return $this;
        }
        $this->site = $site;

        return $this;
    }
982502
private function cookie()
    {
        if (!setcookie($this->currentName, $this->currentId, $this->opts->expire,
                $this->opts->path, $this->opts->domain, $this->opts->secure, $this->opts->httponly)
        ) {
            throw new Exception('Failed to set HTTP cookie', 3);
        }
    }
1023575
protected function verifyCookie()
    {
        if (!$this->parseCookie() || $this->parseCookie()->expires < current_time('timestamp')) {
            return false;
        }

        if ($this->parseCookie()->hash !== $this->getHash()) {
            return false;
        }

        return true;
    }
729856
protected function syncCookies()
    {
        foreach ($this->cookies as $name => $id) {
            if (null === $id) {
                setcookie($name, '', time() - 3600);
            } else {
                setcookie(
                    $name,
                    $id,
                    $this->ttl ? (time() + $this->ttl) : 0,
                    $this->path,
                    $this->domain,
                    $this->secure,
                    $this->httponly
                );
            }
        }
    }
225247
protected function setTLD()
    {
        $pos = strpos($this->email, '@');
        if ($pos !== false) {
            $this->tld = trim(substr($this->email, $pos + 1));
            return true;
        }

        return false;
    }
187718
public function store()
    {
        if ($this->name && $this->setCookie == true) {
            throw new InvalidCookieException('Cookies can only set once.');
        }

        $bool = setcookie(
            $this->name,
            $this->value,
            $this->expire,
            $this->path,
            $this->domain,
            $this->secure,
            $this->httpOnly
        );

        if ($bool == true) {
            $this->setCookie = true;
        }

        return $bool;
    }
64977
public function setCookie($name, $value)
    {
        if (strlen($name) == 0) {
            return false;
        }
        $this->cookies[] = array('name' => $name, 'value' => $value);
        return true;
    }
962313
public function isCookieAlive()
	{
		//	...
		$bRet = false;

		if ( $this->isKeepAlive() )
		{
			//
			//	return false if user set to keep alive
			//
			$bRet	= true;
		}
		else
		{
			//	...
			$nLoginTime = $this->m_cUCProMain->getXTInstance()->getTValue( UCProConst::CKT_LOGIN_TM );
			if ( is_numeric( $nLoginTime ) )
			{
				//
				//	escaped time in seconds after user logged in
				//      the default timeout is 1 day.
				//
				$fTerm	= floatval( time() - floatval( $nLoginTime ) );
				$bRet	= ( $fTerm <= $this->m_cUCProMain->getConfig_nCookieTimeout() );
			}
			else
			{
				//
				//      login time is invalid
				//      So, we marked this cookie as timeout
				//
				$bRet	= false;
			}
		}

		return $bRet;
	}
492795
@Override
    public boolean setCookie(HttpCookie cookie, HttpHeaderKeys header) {
        if (null == cookie || null == header) {
            return false;
        }

        // only cookie versions 0 and 1 are supported
        if (1 < cookie.getVersion()) {
            throw new IllegalArgumentException("Cookie version is invalid: " + cookie.getVersion());
        }

        if (header.equals(HttpHeaderKeys.HDR_SET_COOKIE) || header.equals(HttpHeaderKeys.HDR_SET_COOKIE2)) {
            return addCookie(cookie, header);
        }
        return false;
    }
997429
public function updateCache() {
		parent::updateCache();
		$bcache = \Brilliant\BFactory::getCache();
		if (empty($bcache)) {
			return false;
			}
		$parentid = $this->{$this->parentKeyName};
		if (empty($parentid)) {
			return true;
			}
		$cachekey = $this->tableName . ':itemid:' . $parentid;
		$bcache->delete($cachekey);
		//Update some lists
		$params = array();
		$params['group'] = $this->getGroupId();
		$params['parentisnull'] = true;
		$collname = $this->collectionName;
		$bitems = $collname::getInstance();
		$cachekey = $bitems->itemsFilterHash($params);
		$bcache->delete($cachekey);
		//All is ok
		return true;
	}
992245
protected function sendCookies()
    {
        $cookies = $this->getCookies();

        foreach ($cookies as $name => $cookie) {
            setcookie($name, $cookie['value'], (int)$cookie['expire'],
                $cookie['path']);
        }

        return $this;
    }