public function onBootstrap(MvcEvent $e)
    {
        $manager = Container::getDefaultManager();
        if (!$manager->sessionExists()) {
            return;
        }

        $app = $e->getApplication();
        /** @var \Zend\EventManager\SharedEventManagerInterface $sharedEvm */
        $sharedEvm = $app->getEventManager()->getSharedManager();

        $sharedEvm->attach(
            AbstractActionController::class,
            'dispatch',
            [$this, 'flashMessengerHandler'],
            2
        );
    }