cakephp logo

Not getting setFlash messages in CakePHP 1.2

If your not observing your $this->Session->setFlash messages, make sure you have the following code present in your layout or view ...

Show Plain Text
PHP code
  1. <?php
  2. if ($session->check('Message.flash')) {
  3.   $session->flash();
  4. }
  5. ?>

This caught me out one time after editing the default.ctp layout and accidentally removing the $session->flash() line.

Filed under: Cakephp  Tags: Setflash

12 Responses to “Not getting setFlash messages in CakePHP 1.2”

Gr8 Solution..

No problem, Glad it helped.

tnx men was looking an whole day to let this work and then finnally you mentions this (the only one who's mentioned it ) tnx a lot men

thaks a lot man...cheers..!!

it really works. thanks

Very helpful!

I searh about this topic a whole day ..., thank to you ..., Good Bless You

Thanks, thats a gr888 help..

Very helpful! thk!

Really good help. See these small things you will never find when you are learning anything by yourself. Thanks a lot. Only the developers who were pulling their hairs will know that how much it helped :)

If it doesn't work, add echo before $session->flash();

Perfect Article. You saved me Man. Thanks for sharing such a nice article. really Helpful.

Sorry, comments have been closed for this post.