Persistant flash message [solved]

4.2
Still trying to tame 4.x …

I have a persistant Flash message :
“The Category has been saved”

It appears in all index pages and only in index pages.

All other pages behave as expected.

Any idea ?

Something in a layout or template that is used by index pages. Or something in inherited code used by index methods (like something in AppController).

With no other details of your code I can only give a debugging suggestion. Assuming you have an IDE or other technique for doing directory content searches:

  • Search the files in you Controller folder for the string “The Category has been saved”
  • Next search your Templates folder for the string
  • failing that, search your src folder

Once you find where its coming from it should be easy to figure out how you are inadvertently calling it.

Oh, and one other note; In cake 4x if you redirect from a method that sets a flash message, the flash will survive until the next rendered page. Even throwing an exception and having the system crash, the flash will persist until an eventual page render.

In this way, while debugging an app, it is possible to finally get some page to render and receive multiples of all the flash messages accumulated during all the failed page rendering attempts

Thank you for your tips.
After emptying all caches (cake + browser) and adding :
$this->loadComponent(‘Flash’, [‘clear’ => true]);
and closing session

It disappeared.
I forgot to try with another browser.

Thank you again.