public function set(string $variableName = null, $variableValue = null): Session
    {
        if ($variableName === null) {
            throw new BadMethodCallException('Variable name must be specified');
        }
        if ($variableName === '_MFREG_') {
            throw new InvalidArgumentException('_MFREG_ variable name is not allowed');
        }
        $_SESSION[$variableName] = \base64_encode(\serialize($variableValue));
        $this->variables[$variableName] = \base64_encode(\serialize($variableValue));

        return static::$instance;
    }
public function set(string $variableName = null, $variableValue = null): Session
    {
        if ($variableName === null) {
            throw new BadMethodCallException('Variable name must be specified');
        }
        if ($variableName === '_MFREG_') {
            throw new InvalidArgumentException('_MFREG_ variable name is not allowed');
        }
        $_SESSION[$variableName] = \base64_encode(\serialize($variableValue));
        $this->variables[$variableName] = \base64_encode(\serialize($variableValue));

        return static::$instance;
    }
public function set ( string $ variableName = null , $ variableValue = null ) : Session { if ( $ variableName === null ) { throw new BadMethodCallException ( 'Variable name must be specified' ) ; } if ( $ variableName === '_MFREG_' ) { throw new InvalidArgumentException ( '_MFREG_ variable name is not allowed' ) ; } $ _SESSION [ $ variableName ] = \ base64_encode ( \ serialize ( $ variableValue ) ) ; $ this -> variables [ $ variableName ] = \ base64_encode ( \ serialize ( $ variableValue ) ) ; return static :: $ instance ; }
Sets SESSION variable.

@param string|null $variableName
@param null        $variableValue
@return Session
Sets SESSION variable .