title: How does Laravel unset session flash data?
body: <p>I am currently trying to implement a way to flash session data similarly to how Laravel deals with flash data. I am aware that Laravel override the native session methods that are getting called by functions like session_start.</p>
  
  <p>They seem to do this with the <code>Http foundation</code> package of Symfony by creating custom methods for <code>open</code>, <code>read</code>, <code>write</code>, etc. for the session. This is done by using <code>session_set_save_handler</code>:</p>
  
  <p><a href="http://php.net/manual/en/function.session-set-save-handler.php" rel="nofollow noreferrer">http://php.net/manual/en/function.session-set-save-handler.php</a></p>
  
  <p>By using that function you can implement your open logic for when you start a session or a session gets written to. But so far I can not find the direct logic in the Laravel codebase where flash data is being unset.</p>
  
  <p>It would make sense to unset the flash data right before the <code>write</code> functionality of the session. This way you would unset it for future requests and will be sure it will only happen at the termination of your code.</p>
  
  <p>Could anybody tell me how Laravel deals with session flash messages?</p>