I want to $this->Session->setFlash('text'); $this->redirect('page'); but the message is not displayed.
I have included both the Session Component and Helper, and the $this->Session->setFlash() in my layout. However, after the redirect, the session doesn't contain any message. If I don't redirect, the message is shown.
So my question is, why isn't the flash message preserved after a redirect? It should be, and this how I've done before, but...it doesn't work now.
Thanks for any help!
Here is my controller code:
if(!$this->Test->__test_possible()){
$this->Session->setFlash(__('Insufficient data to create test.', true));
$this->redirect(array('action' => 'index'));
}
...my layout...(the cake default.ctp)
<?php echo $this->Session->flash(); ?>
and the AppController:
var $helpers = array('Html', 'Form', 'Session', 'Facebook.Facebook');
var $components = array('Session', 'Auth', 'Facebook.Connect');