Create a new cookie from the current (template) cookie with a new value.

@param $value
@return Cookie
965342
private function createCookieWithValue($value)
    {
        return new Cookie(
            $this->cookieSettings->getName(),
            $value,
            $this->cookieSettings->getExpiresTime(),
            $this->cookieSettings->getPath(),
            $this->cookieSettings->getDomain(),
            $this->cookieSettings->isSecure(),
            $this->cookieSettings->isHttpOnly()
        );
    }
1087076
public function set($key, $value)
    {
        $this->store[$key] = $value;

        return setcookie($key, $value);
    }
1357374
public function set($name, $value)
    {
        $name = $this->prefix . $name;
        return setcookie($name, $value, $this->expire, $this->path, $this->domain, $this->secure, $this->httpOnly);
    }
1028234
protected function Add( $value )
	{
	    switch ( $value->GetValueCode() )
	    {
	        case DayTimeDurationProxyFactory::Code:
	        	/**
	        	 * @var DayTimeDurationProxy $value
	        	 */
	        	// Clone the DateValue contained in the proxy or the original is changed
	        	$clone = new TimeValue( clone $this->_value->Value, ! $this->_value->IsLocal );
	        	return new TimeProxy( TimeValue::AddDayTimeDuration( $clone, $value->getValue() ) );
	        	// return new TimeProxy( TimeValue::Add( $this->_value, /* DayTimeDurationValue */ $value->getValue() ) );

	        default:
	            throw XPath2Exception::withErrorCodeAndParams( "XPTY0004", Resources::BinaryOperatorNotDefined,
					array(
						"op:add",
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $this->_value), XmlTypeCardinality::One ),
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $value->getValue() ), XmlTypeCardinality::One )
					)
				);
	    }
	}
825228
public function withAttribute($name, $value)
    {
        $attributes = $this->getAttributes();
        if (array_key_exists($name, $attributes) && $attributes[$name] === $value) {
            return $this;
        }

        $attributes[$name] = $value;

        $newInstance = clone $this;
        $newInstance->setAttributes($attributes);
        return $newInstance;
    }
283217
public function with_value( $value ) {
		if ( $this->value === $value ) {
			return $this;
		}

		$cloned_token        = clone $this;
		$cloned_token->value = $value;

		return $cloned_token;
	}
1320111
public function normalizeValue($value)
	{
		if ($value instanceof AbstractNormalization)
		{
			return $value;
		}

		if (is_callable($value))
		{
			return new Custom($value);
		}

		$className = 's9e\\TextFormatter\\Configurator\\TemplateNormalizations\\' . $value;

		return new $className;
	}
553254
public static function setCacheGeneral($value)
    {
        $cache = self::getCache();

        return $cache->save(self::$cacheIdGeneral, $value, self::getTtl());
    }
927064
public function createDateTime($value)
    {
        $date = null;

        if(is_string($value)) {
            $date = new \DateTime($value);
        }

        if(is_int($value)) {
            $date = new \DateTime();
            $date->setTimestamp($value);
        }

        return $date;
    }
1319179
public function cookie(string $name, $value): HttpRequest
    {
        if ($name != 'Array') {
            $this->cookies[$name] = $value;
        }
        return $this;
    }
279860
protected function createValue(&$value)
    {
        $instance = $this->instance($value);
        if (null !== $instance) {
            return $instance;
        }

        $variableType = gettype($value);
        switch ($variableType) {
            case 'boolean':
                return new Value\BooleanValue($value);
            case 'integer':
                return new Value\IntegerValue($value);
            case 'double':
                return new Value\FloatingPointValue($value);
            case 'NULL':
                return new Value\NullValue;
            case 'string':
                return new Value\StringValue($value);
            case 'array':
                return $this->createArray($value);
            case 'object':
                if ($value instanceof DateTime) {
                    return new Value\DateTimeValue($value);
                }

                return $this->createObject($value);
        }

        throw new Exception\UnsupportedValueTypeException($value);
    }
590405
public static function create($value)
    {
        $class = static::class;
        if (!array_key_exists($class, self::$instances)) {
            self::$instances[$class] = [];
        }
        if (!array_key_exists($value, self::$instances[$class])) {
            self::$instances[$class][$value] = new static($value);
        }

        return self::$instances[$class][$value];
    }
31310
public function cookie($name, $value, $expires = 0, $path = '', $domain = '', $secure = false, $httpOnly = false)
    {
        $cookie = new Cookie(
            $name,
            $value,
            $expires
        );

        return $cookie
            ->setPath($path)
            ->setDomain($domain)
            ->setIsSecure($secure)
            ->setIsHttpOnly($httpOnly)
            ->commit();
    }
554706
static public function setCache( $value )
	{
		$old = self::$cache;
		self::$cache = (boolean) $value;

		return $old;
	}
703214
public function setValue($value)
    {
        if (null === $value) {
            $value = $this->getArgument('default');
        }

        $this->value = ($this->needsSanitization())
            ? $this->sanitizeWithCallback($value)
            : $value;

        return $this;
    }
58951
public function setFrom($value)
    {
        if (is_array($value)) {
            $value = new Person($value);
        }
        return $this->setParameter('from', $value);
    }
1101168
public function offsetSet($name, $value)
    {
        $cookie = $this->_classes['cookie'];
        $value = $this->_autobox($name, $value);
        if (!$value instanceof $cookie) {
            throw new RuntimeException("Error, only `{$cookie}` instances are allowed in this collection.");
        }
        $hash = $name . ';' . $value->domain() . ';' . $value->path();
        $this->_hashes[$name][] = $hash;
        $this->_names[$hash] = $name;

        return $this->_data[$hash] = $value;
    }