We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Flash message not showing up

Hello,

When i use this code :

$this->flash->error('Incorrect login'); return $this->dispatcher->forward(array( 'controller' => 'session', 'action' => 'index' ));

When i get redirected to session/index i don't see the flash message. But if i remove the forward, the flash message shows up on the session/login page (where the code above is).

Why is that ?? I don't understand the issue. I've tried adding :

$this->flash->output() in the initialize of BaseController



4.5k

Ok i used flashSession and added $this->flashSession->output() in initialize of ControllerBase, also changed my forward to redirect for it to work.

Thanks!