src/Leevel/Session/Session.php
public function unregisterFlash(): void
    {
        $arr = $this->get($this->flashNewKey(), []);
        $old = $this->get($this->flashOldKey(), []);

        foreach ($old as $item) {
            $this->delete($this->flashDataKey($item));
        }

        $this->delete($this->flashNewKey());
        $this->set($this->flashOldKey(), $arr);

        unset($arr, $old);
    }
public function unregisterFlash(): void
    {
        $arr = $this->get($this->flashNewKey(), []);
        $old = $this->get($this->flashOldKey(), []);

        foreach ($old as $item) {
            $this->delete($this->flashDataKey($item));
        }

        $this->delete($this->flashNewKey());
        $this->set($this->flashOldKey(), $arr);

        unset($arr, $old);
    }
程序执行结束清理 flash.