views:

51

answers:

1

I am using:

$this->Session->setFlash('gotcha!!', 'msg_success');

to write a msg in the Session and try to access it in the file

\app\views\elements\msg_success.ctp

with the code

if($session->check('Message.flash'))
{
    echo $session->flash();
}

My Phpinfo() says

memory_limit 512M 512M

My app/config/core.php says

Configure::write('Session.save', 'php');
Configure::write('Session.cookie', 'CAKEPHP');
Configure::write('Session.start', true);

how can that be???

A: 

Make sure you have the Session Component and the Session Helper set in the controller. They are not on by default. Although, I would assume it would throw an error, not eat up your memory.

Also, you shouldn't need to do if($session->check('Message.flash')) before using $this->Session->flash(). It should degrade gracefully if no flash message has been set.

Stephen

related questions