Set a timeout on key.

@param string $key
@param int    $expire

@return void
489548
public function setTtl($key, $expire)
    {
        if (is_null($expire)) {
            return;
        }

        $expire = (int) $expire;

        if ($expire > 0) {
            $this->getConnection()->expire($key, $expire);
        } else {
            $this->getConnection()->persist($key);
        }
    }
1145340
public function setWithExpire($key, $value, $expire)
    {
        if (setcookie($key, $value, time() + $expire, '/', '', false, true)) {
            return true;
        }
        return false;
    }
489211
public function expireAfter($key, $expire = 0)
    {
        $val = $this->mem->get($key);

        if (isset($val)) {
            return $this->set($key, $val, $expire);
        }

        return false;
    }
1143030
protected function setCookie($key, $value = null, $expire = 0)
    {
        if ($value === null) {
            Arr::forget($_COOKIE, $key);
        } else {
            if ($this->defaults['encrypt']) {
                $value = $this->getEncryption()->encryptBase64($value);
            }

            Arr::set($_COOKIE, $key, $value);
        }

        setcookie(
            $key,
            $value,
            $expire,
            $this->defaults['path'],
            $this->defaults['domain'],
            $this->defaults['secure'],
            $this->defaults['httponly']
        );
    }
121917
public function set($key, $value, $expire = 0)
    {
        $value = json_encode($value, JSON_UNESCAPED_UNICODE);
        if ($expire > 0) {
            return $this->hash($key)->setex($key, $expire, $value);
        } else {
            return $this->hash($key)->set($key, $value);
        }
    }
1344811
public function cache($key, $expires = null) {
        if ($this->getType() !== self::SELECT) {
            return $this;
        }

        $this->_cacheKey = $key;
        $this->_cacheLength = $expires;

        return $this;
    }
773045
public function set($value,  int $expire = 0): bool
    {
        return parent::setString(json($value),  $expire);
    }
498495
public function set($key, $value, $expiration = 300) {

    	if(false === ('-' . intval($expiration) == '-' . $expiration)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($expiration)), E_USER_ERROR);
		}
    	
    	$this -> call() -> set($key, $value, $expiration);
    	return $this;
    }
485943
public function touch($key, $expiration = null) {

    	if(null !== $expiration && false === ('-' . intval($expiration) == '-' . $expiration)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($expiration)), E_USER_ERROR);
		}

		$this -> call() -> touch($key, $expiration);
		return $this;
    }
1079189
public function set($key, $value, $expiration = false)
    {
        $path = $this->filename($key);
        $umask = umask($this->umask);
        file_put_contents($path, $this->createValue($value, $expiration));
        umask($umask);
        return $this;
    }
1308219
public function set($key, $value, $expire = 600) {
        $this->redis->setex($this->formatKey($key), $expire, $this->formatValue($value));
    }
1215778
public static function set(string $key, $value, int $expire = null): bool
    {
        return self::storage()->set($key, $value, $expire);
    }
102144
public function updateExpire(string $key, int $expire): bool
    {
        if (!$this->ifExists($key)) {
            throw new Exception(
                'The key '.$key.' not exist on memcache(d) server',
                self::ERR_KEY_NOT_EXIST
            );
        }
        
        return $this->touch($key, $expire);
    }
469685
protected function expiration($key)
	{
		$lifetime = ini_get("session.gc_maxlifetime");

		$expire = $this->engine->get($key . '_expire');

		// Set prune period
		if ($expire + $lifetime < time())
		{
			$this->engine->delete($key);
			$this->engine->delete($key . '_expire');
		}
		else
		{
			$this->engine->replace($key . '_expire', time());
		}
	}
1192758
public function set($key, $value, $expiry = null)
	{
		// make sure we have a valid key
		if ($key === null)
		{
			throw new \RuntimeException('No valid key passed to setFlash()');
		}

		// get the default expiry if none is given
		$expiry === null and $expiry = $this->defaultExpiryState;

		// validate the expiry
		if ( ! in_array($expiry, $this->expiryStates))
		{
			throw new \RuntimeException('"'.$expiry.'" is not a valid session flash variable expiration state.');
		}

		// store the expiry information for this key
		$this->data[static::EXPIRE_DATA_KEY][$key] = array($expiry, static::EXPIRE_STATE_NEW);

		// and store the value passed
		parent::set($this->prefixKey($key), $value);
	}
1363189
function setCache($cache,$expire=3600)
	{
		$this->cache = $cache;
		$this->if_cache = true;
		$this->expire = $expire;
	}
1227871
public function setExpires(string $expires)
    {
        if (empty($expires)) {
            Throw new HeaderException('Empty expires is not allowed.');
        }

        $this->expires = $expires;
    }