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 i开发者_Python百科s seems like, its getting the information's from cache and displaying.
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'.
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
精彩评论