In the class reference it says:


Stores a flash message. A flash message is available only in the current and the next requests.

Since the flash is available for two requests I keep finding them appearing twice to the user when they should only appear once.  I think this is not what most want.

What CakePHP did, and I think makes more sense, is that the flash was instead deleted after it was retrieved with getFlash() for the first time.  Then CakePHP had another argument in the getFlash function that could be set to false if you did not want the flash to be deleted after retrieval.

Eg it would look something like this:


	public function getFlash($key,$defaultValue=null, $delete=true)


		$flash = $this->getState(self::FLASH_KEY_PREFIX.$key,$defaultValue)

		$delete && $this->setFlash($key, null);

		return $flash;


That seems reasonable to me. Thanks. Fix checked in.

Great! Thank you!