framework/web/Session.php
public function removeFlash($key)
    {
        $counters = $this->get($this->flashParam, []);
        $value = isset($_SESSION[$key], $counters[$key]) ? $_SESSION[$key] : null;
        unset($counters[$key], $_SESSION[$key]);
        $_SESSION[$this->flashParam] = $counters;

        return $value;
    }
public function removeFlash($key)
    {
        $counters = $this->get($this->flashParam, []);
        $value = isset($_SESSION[$key], $counters[$key]) ? $_SESSION[$key] : null;
        unset($counters[$key], $_SESSION[$key]);
        $_SESSION[$this->flashParam] = $counters;

        return $value;
    }
Removes a flash message.
@param string $key the key identifying the flash message. Note that flash messages
and normal session variables share the same name space.  If you have a normal
session variable using the same name, it will be removed by this method.
@return mixed the removed flash message. Null if the flash message does not exist.
@see getFlash()
@see setFlash()
@see addFlash()
@see removeAllFlashes()