title: Laravel 5.2: Session store not set on request. Error for Blade Templates with old()
body: <p>I am testing with PHPUnit 4.0, Laravel 5.2, PHP 5.5.9, and keep getting the error ERROR: exception 'RuntimeException' with message 'Session store not set on request.' in /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Request.php:85</p>
  
  <p>To rule it out, middleware is enabled.</p>
  
  <p>If I remove {{ old('username') }} from the form, the error goes away.  I have seen several posts in regards to this issue using the old() method; however, I have updated the kernel.php, moved the route under a middleware group to reference 'web', even moved start session to the default middleware array() in kernel.php.  I have also, tried calling the session from TestCase.php.  None of the forums seem to have a working solution.  Is there something I'm missing in the syntax, or is there a bug in Laravel?</p>
  
  <p>My kernel.php file looks like</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http;
  
  use Illuminate\Foundation\Http\Kernel as HttpKernel;
  
  class Kernel extends HttpKernel
  {
  
      protected $middleware = [
          \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
          \Illuminate\Session\Middleware\StartSession::class,
          \Illuminate\View\Middleware\ShareErrorsFromSession::class
      ];
  
      protected $middlewareGroups = [
          'web' =&gt; [
              \App\Http\Middleware\EncryptCookies::class,
              \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
              \App\Http\Middleware\VerifyCsrfToken::class,
          ],
          'api' =&gt; [
              'throttle:60,1',
          ],
      ];
  
      protected $routeMiddleware = [
          'sso'           =&gt; \App\Http\Middleware\SsoEnabled::class
          ];
  }
  </code></pre>
  
  <p>My signup.blade.php looks like:</p>
  
  <pre><code>@extends('layouts.main')
  @section('body')
      &lt;body&gt;
      &lt;h2&gt;Signup&lt;/h2&gt;
      &lt;form class="m-t" role="form" method="POST" action="/signup"&gt;
          &lt;div class="form-group"&gt;
              &lt;input name="username" type="text" placeholder="Username" value="{{ old('username') }}" required=""&gt;
          &lt;/div&gt;
          &lt;button type="submit" name="Signup" &gt;Signup&lt;/button&gt;
      &lt;/form&gt;
      &lt;/body&gt;
  @endsection
  </code></pre>
  
  <p>My routes.php looks like:</p>
  
  <pre><code>&lt;?php
  
      Route::group(['middleware' =&gt; ['web']], function () {
  
              Route::group(array('middleware' =&gt; ['sso:0']), function ($key) {
  
                  Route::get('signup/{token}', [
                      'as'   =&gt; 'customer.signup',
                      'uses' =&gt; 'SignupController@getApplication'
          ]);
      });
  });
  </code></pre>
  
  <p>I have even tried adding a new block to the testCase.php setUp without any luck:</p>
  
  <pre><code>$this-&gt;app['config']-&gt;set('session', [
      'driver'          =&gt; 'array',
      'lifetime'        =&gt; 120,
      'expire_on_close' =&gt; false,
      'encrypt'         =&gt; false,
      'lottery'         =&gt; [2, 100],
      'path'            =&gt; '/',
      'domain'          =&gt; 'localhost',
      'secure'          =&gt; true,
      'email'           =&gt; 'email@email.com',
      'store'           =&gt; 'storage'
  ]);
      $kernel = app('Illuminate\Contracts\Http\Kernel');
      $kernel-&gt;pushMiddleware('Illuminate\Session\Middleware\StartSession');
  </code></pre>