title: Laravel 5.2 token mismatch
body: <p>I'm updating a Laravel 5.1 site to Laravel 5.2.39. I had a lot of issues with the "approved" upgrade process (in particular the middleware) so I ended up creating a new Laravel 5.2 site and just moving over my views, models and controllers from the old site. It seems to be working, except when I submit any form I get a token mismatch exception:</p>
  
  <pre><code>TokenMismatchException in VerifyCsrfToken.php line 67:
  </code></pre>
  
  <p>My forms have the token (using <code>{{ csrf_field() }}</code>) in them:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      {!! Form::label('name', 'Name') !!}
      {!! Form::text('name', old('name'), ['placeholder' =&gt; 'Name', 'class' =&gt; 'form-control']) !!}
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      {!! Form::label('email', 'Email') !!}
      {!! Form::email('email', old('email'), ['placeholder' =&gt; 'Email', 'class' =&gt; 'form-control']) !!}
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      {!! Form::label('phone', 'Phone') !!}
      {!! Form::text('phone', old('phone'), ['placeholder' =&gt; 'Phone', 'class' =&gt; 'form-control']) !!}
  &lt;/div&gt;
  {{ csrf_field() }}
  &lt;div class="form-group"&gt;
      {!! Form::submit('Submit', ['class' =&gt; 'btn btn-default btn-small']) !!}
      &lt;input type="reset" class="btn btn-primary btn-small" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and I have cleared my cookies and also tried setting the <code>config/session.php</code> <code>lifetime</code> to a higher number to ensure it's not timing out. </p>
  
  <p>This is running on a homestead box.</p>
  
  <p>Any ideas what to try?</p>
  
  <p>EDIT: here's the route in question</p>
  
  <pre><code>Route::resource('contact', 'ContactController');
  </code></pre>
  
  <p>EDIT2: here's the route file. I don't believe it is required to wrap the routes in the web middleware in Laravel 5.2-- however, I've tried it both ways with the same error.</p>
  
  <pre><code>Route::group(['middleware' =&gt; ['web']], function () {
  
      Route::get('/', 'AccountController@index');
  
      Route::resource('account', 'AccountController');
      Route::resource('contact', 'ContactController');
  
  });
  </code></pre>
  
  <p>Dumping the <code>$request-&gt;session()-&gt;token()</code> in the controller's create action shows the current session token on the page with the form. This is the same token that is added to the form (checked with view source). </p>
  
  <p>But when it gets to the <code>Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::tokensMatch()</code> class, I dump the session token and it's different than the form token-- meaning these will never match. Not sure what to expect here.</p>