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;
    }
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;
    }
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 ; }
Define o nome do cookie.

@param       string $name
Nome do cookie.

@return      void

@throws      \InvalidArgumentException
Caso o valor indicado seja inválido.
Define o nome do cookie .