public function set(string $variableName = null, $variableValue = null, array $expires = ['m' => 1],
                        bool $encrypted = true): Cookie
    {
        if ($variableName === null) {
            throw new BadMethodCallException('Variable name must be specified');
        }

        \setcookie(
            $variableName,
            $encrypted === true ? $variableValue : $variableValue,
            $this->getExpireTime($expires),
            $this->getPath(),
            $this->getDomain(),
            $this->isSecure(),
            $this->isHttpOnly()
        );
        $this->variables[$variableName] = $variableValue;

        return static::$instance;
    }
public function set(string $variableName = null, $variableValue = null, array $expires = ['m' => 1],
                        bool $encrypted = true): Cookie
    {
        if ($variableName === null) {
            throw new BadMethodCallException('Variable name must be specified');
        }

        \setcookie(
            $variableName,
            $encrypted === true ? $variableValue : $variableValue,
            $this->getExpireTime($expires),
            $this->getPath(),
            $this->getDomain(),
            $this->isSecure(),
            $this->isHttpOnly()
        );
        $this->variables[$variableName] = $variableValue;

        return static::$instance;
    }
public function set ( string $ variableName = null , $ variableValue = null , array $ expires = [ 'm' => 1 ] , bool $ encrypted = true ) : Cookie { if ( $ variableName === null ) { throw new BadMethodCallException ( 'Variable name must be specified' ) ; } \ setcookie ( $ variableName , $ encrypted === true ? $ variableValue : $ variableValue , $ this -> getExpireTime ( $ expires ) , $ this -> getPath ( ) , $ this -> getDomain ( ) , $ this -> isSecure ( ) , $ this -> isHttpOnly ( ) ) ; $ this -> variables [ $ variableName ] = $ variableValue ; return static :: $ instance ; }
Sets COOKIE variable.

@param string|null $variableName
@param null        $variableValue
@param array       $expires
@param bool        $encrypted
@return Cookie
Sets COOKIE variable .