I have a rather strange problem with the flash messenger in ZF2. I use it in a fairly simple scenario, saving the message "registration is complete" after registering and redirecting to the login page and displaying the message, however, the messages are never returned by the flash messenger.
In the action of the controller register:
$this->flashMessenger()->addMessage('Registration complete');
return $this->redirect()->toRoute('default', array('controller' => 'user', 'action' => 'login'));
In the action of entering the controller:
$flashMessenger = $this->flashMessenger();
$mes = $flashMessenger->hasMessages();
$cur = $flashMessenger->hasCurrentMessages();
Both $ mes and $ cur are false (I tried to make sure). Can anyone shed some light on this?
I am using ZF 2.2.2 and PHP 5.3.14. The session persistence handler uses the dbtable adapter, and I tried to disable it, and also set the flashmessenger session manager to use the same dbtable persistent handler with no result.