In your controller
public function init()
{
$messages = $this->_helper->flashMessenger->getMessages();
if(!empty($messages))
$this->_helper->layout->getView()->message = $messages[0];
}
in your layout.phtml
<?php if(isset($this->message)) :?>
<div class="notification">
<?php echo $this->message ;?>
</div>
<?php endif;?>
Then when you want to use it
public function loginAction()
{
$this->_helper->flashMessenger('Login is success');
$this->_helper->redirector('home');
}
You will be redirected almost every time after using flashMessenger.