session - Prevent the same setFlash() message from being output on every page -


i new cakephp , have inherited project uses cakephp v1.3 , displays various messages user using $this->session->setflash().

one such instance message displaying after successful login site. problem is, same message pop on every subsequent page user visits. how prevent behaviour?

to show flashmessages once, should output them using;

echo $this->session->flash(); 

inside view. see displaying notifications or flash messages

this method remove output session after displaying it.

if you're displaying messages via custom method, sure clear message session afterward, using;

$this->session->delete('message.flash'); 

inside view


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -