tags:

views:

67

answers:

2

Hi, I am using $this->Session->setFlash to flash the error messages to the browser and its working fine.

But, unfortunately, it is displaying the messages when it shouldn't display also. It is seems like, its getting the information's from cache and displaying.

Please let me know, is there any way to solve it?

A: 

The flash messages are stored in the user's session. If a user opens up two browser windows. And performs some action on one window that causes a flash, but the user reloads a page in the second browser before the first one redirects the second one will show the flash.

With that said does that sound like your issue? Does it show the flash twice? Please elaborate and be more specific as to when 'it displays when it shouldn't'.

xcezzz
A: 

Maybe the layout of the page where you want the flash message to show doesn't print flash messages and then it shows up in the layout where you print the flash message

Nigel