title: Using browser back button in triggers flash message in CakePHP again
body: <p>I just came across a bit of a puzzling situation. My controller action looks like this:</p>
  
  <pre><code>public function myaction($eventId = false) {
      if(!$eventId) {
          //list all events
          $data = foo;
      } else {
          if(!$this-&gt;Event-&gt;findById($eventId) )
          {
              $this-&gt;Session-&gt;setFlash('myerror message', 'flash_frontend_message');
              $this-&gt;redirect(array('controller' =&gt; 'events', 'action' =&gt; 'myaction'));
          } else {
              // display event information
              $data = foo;
          }
      }
      $this-&gt;set($data);
  }
  </code></pre>
  
  <p>If I call the function with an $eventId that is not found in the database, it outputs an error message and the user gets redirected back to the list of all events. However lets say I then select an eventId which is valid, view the relevant information and then press the browser back button, the previous flash message gets out put again, even though the URL in this case does not contain the $eventId.</p>
  
  <p>I suppose what happens is that the page gets loaded from the browser cache rather then reloaded. I have tried to avoid storing the view in the cache like this:</p>
  
  <pre><code>&lt;!--nocache--&gt;
  &lt;?php echo $this-&gt;Session-&gt;flash(); ?&gt;
  &lt;?php echo $this-&gt;Session-&gt;flash('auth'); ?&gt;
  &lt;!--/nocache--&gt;
  </code></pre>
  
  <p>but still, the flash message gets displayed.</p>
  
  <p>Any idea how to prevent this behavior? 
  Is there perhaps a way to clear the flash after it has been displayed?</p>