private function generateToken(string $formName): string
    {
        $token = Cryptography::randomString(self::TOKEN_LENGTH);
        $csrfData = Session::getInstance()->read('__CSRF_TOKEN', []);
        $csrfData[$formName] = $token;
        Session::getInstance()->set('__CSRF_TOKEN', $csrfData);
        return $token;
    }
private function generateToken(string $formName): string
    {
        $token = Cryptography::randomString(self::TOKEN_LENGTH);
        $csrfData = Session::getInstance()->read('__CSRF_TOKEN', []);
        $csrfData[$formName] = $token;
        Session::getInstance()->set('__CSRF_TOKEN', $csrfData);
        return $token;
    }
private function generateToken ( string $ formName ) : string { $ token = Cryptography :: randomString ( self :: TOKEN_LENGTH ) ; $ csrfData = Session :: getInstance ( ) -> read ( '__CSRF_TOKEN' , [ ] ) ; $ csrfData [ $ formName ] = $ token ; Session :: getInstance ( ) -> set ( '__CSRF_TOKEN' , $ csrfData ) ; return $ token ; }
Generates and stores in the current session a cryptographically random
token that shall be validated with the filter method.

@param string $formName
@throws \Exception
@return string
Generates and stores in the current session a cryptographically random token that shall be validated with the filter method .