title: Laravel site exception 'Illuminate\Session\TokenMismatchException'
body: <p>Laravel 5.1</p>
  
  <p>I'm getting this error occasionally, most often on log in on IE11 but sometimes on AJAX calls too. I have the appropriate csrf fields in my log in form and I've also added it to the AjaxSetup function. </p>
  
  <p>I think it's happening with ajax because the users are coming back to the page after a while and trying to use a function after their session has expired.</p>
  
  <p>The IE11 issue confuses me though since they're logged out already. </p>
  
  <ol>
  <li><p>How can I automatically redirect to login when an ajax function is uses after session has expired?</p></li>
  <li><p>What can I do to prevent IE11 from generating this error when trying to log in?</p></li>
  </ol>
  
  <p>.</p>
  
  <pre><code>Error of type ERROR [03/02/2016 11:06 am]: exception 'Illuminate\Session\TokenMismatchException' on page /var/www/vendor/bootstrap/cache/compiled.php
  Stack trace:
  #0 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #1 /var/www/vendor/bootstrap/cache/compiled.php(9585): call_user_func_array(Array, Array)
  #2 /var/www/vendor/bootstrap/cache/compiled.php(12961): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #3 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #4 /var/www/vendor/bootstrap/cache/compiled.php(9585): call_user_func_array(Array, Array)
  #5 /var/www/vendor/bootstrap/cache/compiled.php(11555): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #6 [internal function]: Illuminate\Session\Middleware\StartSession-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #7 /var/www/vendor/bootstrap/cache/compiled.php(9585): call_user_func_array(Array, Array)
  #8 /var/www/vendor/bootstrap/cache/compiled.php(12698): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #9 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #10 /var/www/vendor/bootstrap/cache/compiled.php(9585): call_user_func_array(Array, Array)
  #11 /var/www/vendor/bootstrap/cache/compiled.php(12635): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #12 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #13 /var/www/vendor/bootstrap/cache/compiled.php(9585): call_user_func_array(Array, Array)
  #14 /var/www/vendor/bootstrap/cache/compiled.php(2982): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #15 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #16 /var/www/vendor/bootstrap/cache/compiled.php(9585): call_user_func_array(Array, Array)
  #17 [internal function]: Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #18 /var/www/vendor/bootstrap/cache/compiled.php(9575): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #19 /var/www/vendor/bootstrap/cache/compiled.php(2254): Illuminate\Pipeline\Pipeline-&gt;then(Object(Closure))
  #20 /var/www/vendor/bootstrap/cache/compiled.php(2237): Illuminate\Foundation\Http\Kernel-&gt;sendRequestThroughRouter(Object(Illuminate\Http\Request))
  #21 /var/www/vendor/public/index.php(54): Illuminate\Foundation\Http\Kernel-&gt;handle(Object(Illuminate\Http\Request))
  #22 {main}
  </code></pre>