public function withValue(?string $value = null): Cookie
    {
        $this->validateValue($value);

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

        return $new;
    }
public function withValue(?string $value = null): Cookie
    {
        $this->validateValue($value);

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

        return $new;
    }
public function withValue ( ? string $ value = null ) : Cookie { $ this -> validateValue ( $ value ) ; $ new = clone $ this ; $ new -> value = $ value ; return $ new ; }
Sets the value.

@param null|string $value

@return $this
Sets the value .