title: laravel csrf token mismatch exception after session timeout
body: <p>in our laravel 5 app, the login is through ajax. if user logout and log back in before session expires, everything is fine. but if user logout and stay idle on that page until session is expired, user will get a <code>csrfTokenMismatch</code> exception if they attempt to log back in.</p>
  
  <p>i know in <code>verifyCsrfToken</code> middleware, laravel checks if session matches with the csrf token. also in <code>Guard.php logout()</code> method, session will be cleared on logout. </p>
  
  <p>so my questions are:</p>
  
  <p>is session really flushed on logout, if so how come user can still log back in before the session i set expires?</p>
  
  <p>what happens to csrf token when session is expired?</p>
  
  <p>and lastly, how is this issue usually handled in an elegant way?</p>
  
  <p>Thanks in advance!</p>