Define o nome do cookie.

@param       string $name
Nome do cookie.

@return      void

@throws      \InvalidArgumentException
Caso o valor indicado seja inválido.
481825
public function setName(string $name) : void
    {
        if ($name === "" || preg_match("/^([a-zA-Z0-9_])+$/", $name) !== 1) {
            throw new \InvalidArgumentException("Invalid cookie name. Use only a-zA-Z0-9 characters.");
        }

        $this->name = $name;
    }
1205003
public static function has($name)
    {
        !isset(self::$init) && self::init();

        return isset($_COOKIE[$name]);
    }
32984
public function delete(string $name)
    {
        foreach ($this->scheduled as $index => $cookie) {
            if ($cookie->getName() == $name) {
                unset($this->scheduled[$index]);
            }
        }

        $this->scheduled[] = new Cookie($name, null, -86400);
    }
1110452
public function add(string $name, string $value): void
	{
		$this->cookies[$name] = $value;
	}
507512
public function referenceBegin($name): void
    {
        $this->client->sendBuffer .= $this->client->preparedToSendBuffer;
        $this->client->preparedToSendBuffer = null;
        $signature = sprintf('<H p="1" v="%s">', $name);
        $this->write($signature);
        $signature[6] = '2';
        $this->client->currentArgumentsFormat = $signature;
    }
1153389
static public function getCookie($name= null)
    {
        if ($name) $name = static::$COOKIE_PREFIX . $name;
        return empty($name) ? $_COOKIE : (isset($_COOKIE[$name]) ? $_COOKIE[$name] : '');
    }
1275449
public function setName( $name )
	{
		if ( $name == $this->getName() ) { return; }

		$this->_values['name'] = (string) $name;
		$this->setModified();
	}
266971
protected function validateName($name)
    {
        if (preg_match("/[=,;\t\r\n\013\014]/", $name)) {
            throw new InvalidArgumentException(
                sprintf('The cookie name `%s` contains invalid characters.', $name)
            );
        }

        if (empty($name)) {
            throw new InvalidArgumentException('The cookie name cannot be empty.');
        }
    }
359021
public function setName(string $name): void
    {
        if (!Validator::fullyQualifiedDomainName($name)) {
            throw new \InvalidArgumentException(sprintf('Zone "%s" is not a fully qualified domain name.', $name));
        }

        $this->name = $name;
    }
177821
public function name($name)
    {
        if (is_null($name)) {
            throw new \InvalidCookieException('Cookie name cannot be null');

            return false;
        }

        $this->name = (string) $this->security->sanitize($name);

        return $this;
    }
1344696
public function setName($name)
    {
        if (in_array($name, MathFunctions::asArray())) {
            $this->name = $name;
        } else {
            $msg = "The name attribute must be a value from the MathFunctions enumeration, '" . $name . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1245948
public function setName($name)
    {
        //Check for invalid cookie name (from PHP source code)
        if (preg_match("/[=,; \t\r\n\013\014]/", $name)) {
            throw new InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name));
        }

        //Check for empty cookie name
        if (empty($name)) {
            throw new InvalidArgumentException('The cookie name cannot be empty.');
        }

        $this->_name = $name;
        return $this;
    }
333891
public function set(string $name, RequestCookieInterface $requestCookie): void
    {
        $this->requestCookies[$name] = $requestCookie;
    }
1121958
public function setName($name)
    {
      if(!is_string($name) || strlen(trim($name)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid name, must be a non empty string');

      $this->name = $name;
    }
964420
public function remove($name)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string');

        $this->set($name, null, time() - 3600);

        unset($_COOKIE[$name]);

        return $this;
    }
545596
public function removeCookie(string $name)
    {
        if (isset($this->cookies[$name])) {
            unset($this->cookies[$name]);
            $this->setHeadersFromCookies();
        }
    }
1013701
public function removeHeader($name)
    {
        if (!$this->hasHeader($name)) {
            throw new \InvalidArgumentException(sprintf('The request header "%s" does not exist.', $name));
        }

        unset($this->headers[$name]);
    }