Set a browser’s cookie remember-me string.

@param	string	IANA time zone identifier.
@return	bool
354475
public function createRememberMe(string $timezone): bool {
		
		// set a random string
		$this->rememberMe = Utilities::getRandomString(32);
		
		if (!$this->store()) {
			return FALSE;
		}

		// serialize an array with timezone and RememberMe string
		$content = serialize([$timezone, $this->rememberMe]);
		
		// expire in 30 days
		$expire = time() + 60*60*24*30;
		
		// set cookie and return the result
		return setcookie(static::getRememberMeCookieName(), $content, $expire, '/');
		
	}
295726
private function refreshRememberCookie(UserInterface $user, $gerenateToken = true)
    {
        $expire = is_numeric($this->expire) ? time() + 60 * $this>expire : strtotime("+" . $this->expire);
        if (!$gerenateToken) {
            $token = $_COOKIE[$this->cookieName];
        } else {
            $token = $this->randomPassword(32);
        }

        $this->rememberMeProvider->setUserRememberMeToken($user, $token);

        setcookie($this->cookieName, $token, $expire, $this->url);
    }
1186447
function (name) {
      var hostname = document.location.hostname;
      if (hostname.indexOf('www.') === 0) {
        hostname = hostname.substring(4);
      }
      document.cookie = name + '=; domain=.' + hostname + '; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/';
      document.cookie = name + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/';
    }
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;
    }
961252
private function setCookieJar()
    {
        switch($this->options['cookie_type']){
            case 'array':
                $this->cookiejar = new CookieJar();
                break;
            case 'file':
                $this->cookiejar = new FileCookieJar($this->options['cookie_file_name']);
                break;
            case 'session':
                $this->cookiejar = new SessionCookieJar($this->options['cookie_session_key']);
                break;
            default:
                throw new YouHostingException("You didn't specify a valid cookie type!");
        }
    }
1134304
protected function setCookie($name, $value = null, $expire = null, $domainPath = null, $https = null, $httpOnly = null)
    {
        return setcookie($name, $value, $expire, $domainPath, $https, $httpOnly);
    }
864730
public static function set($identifier, $value)
    {
        list($hash, $keys) = self::_parseIdentifier($identifier);

        // Add to _REQUEST hash if original hash is get, post, or cookies
        if (in_array($hash, array('GET', 'POST', 'COOKIE'))) {
            self::set('request.'.implode('.', $keys), $value);
        }

        // Store cookies persistently
        if ($hash == 'COOKIE' && strpos(AnRequest::scheme(), 'http') !== false) {
            // rewrite the $keys as foo[bar][bar]
            $ckeys = $keys; // get a copy
            $name = array_shift($ckeys);
            foreach ($ckeys as $ckey) {
                $name .= '['.$ckey.']';
            }

            if (! setcookie($name, $value)) {
                throw new AnRequestException("Couldn't set cookie, headers already sent.");
            }
        }

        // Store in $GLOBALS
        foreach (array_reverse($keys, true) as $key) {
            $value = array($key => $value);
        }

        // Add the global if it's doesn't exist
        if (! isset($GLOBALS['_'.$hash])) {
            $GLOBALS['_'.$hash] = array();
        }

        $GLOBALS['_'.$hash] = AnHelperArray::merge($GLOBALS['_'.$hash], $value);
    }
662373
public function setCookie(
        $name = "",
        $value = "",
        $expire = 0,
        $path = "/",
        $domain = "",
        $secure = false,
        $httpOnly = false
    ) {
        Cookies::$plugin->cookies->set(
            $name,
            $value,
            $expire,
            $path,
            $domain,
            $secure,
            $httpOnly
        );
    }
238147
@Override
    public boolean set(HttpCookie cookie, byte[] attribValue) {
        if (null != attribValue && 0 < attribValue.length) {
            cookie.setComment(HttpChannelUtils.getEnglishString(attribValue));
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Cookie Comment set to " + cookie.getComment());
            }
            return true;
        }
        return false;
    }
377878
public static function setCookie(
        ResponseInterface $response,
        /*# string */ $name,
        /*# string */ $value = null,
        /*# int */ $ttl = null,
        /*# string */ $path = null,
        /*# string */ $domain = null,
        /*# bool */ $secure = false,
        /*# bool */ $httponly = true
    )/*# : ResponseInterface */ {
        $cookie = urlencode($name) . '=' . urlencode($value);

        self::addExpire($cookie, $ttl);

        self::addDomain($cookie, $domain);

        self::addPath($cookie, $path);

        self::addSecure($cookie, $secure);

        self::addHttpOnly($cookie, $httponly);

        return $response->withAddedHeader('Set-Cookie', $cookie);
    }
1053530
public static function set_cookie(
        $name,
        $value,
        $expiry = 90,
        $path = null,
        $domain = null,
        $secure = false,
        $httpOnly = false
    ) {
        Deprecation::notice('0.2', 'This method is no longer required. Please use Cookie::set');
        Cookie::set($name, $value, $expiry, $path, $domain, $secure, $httpOnly);
    }
1219729
public function set(string $timezone): bool {
    $auth = false;
    try {
      if (!empty($timezone)) {
        date_default_timezone_set($timezone);
        $auth = true;
      }
    } catch (Exception $ex) {
      throw $ex;
    }
    return $auth;
  }
1285697
public static function set($name, $value, $time = null, $path = null, $domain = null, $secure = null, $httponly = null)
    {
        return Router::getInstance()->setCookie($name, $value, $time, $path, $domain, $secure, $httponly);
    }
1007963
public function set($name, $value, $expire=0, $path='', $domain='', $secure=FALSE, $httponly=FALSE) {
		$_COOKIE[$name] = $this->encrypt( $value );
		return setcookie($name, $_COOKIE[$name], $expire, $path, $domain, $secure, $httponly);
	}
1282573
def set_cookie(cookies, key, value='', max_age=None, expires=None, path='/',
               domain=None, secure=False, httponly=False):
    ''''''
    cookies[key] = value
    if expires is not None:
        if isinstance(expires, datetime):
            now = (expires.now(expires.tzinfo) if expires.tzinfo else
                   expires.utcnow())
            delta = expires - now
            # Add one second so the date matches exactly (a fraction of
            # time gets lost between converting to a timedelta and
            # then the date string).
            delta = delta + timedelta(seconds=1)
            # Just set max_age - the max_age logic will set expires.
            expires = None
            max_age = max(0, delta.days * 86400 + delta.seconds)
        else:
            cookies[key]['expires'] = expires
    if max_age is not None:
        cookies[key]['max-age'] = max_age
        # IE requires expires, so set it if hasn't been already.
        if not expires:
            cookies[key]['expires'] = http_date(time.time() + max_age)
    if path is not None:
        cookies[key]['path'] = path
    if domain is not None:
        cookies[key]['domain'] = domain
    if secure:
        cookies[key]['secure'] = True
    if httponly:
        cookies[key]['httponly'] = True
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;
  }
655502
def set_cookie(self, cookie=None):
        """"""
        if cookie:
            self._cookie = cookie.encode()
        else:
            self._cookie = None