title: Get Session value in Middleware Laravel 5.5
body: <p>I have created Web App that use angular 4 frontend and Larvel Backend for create Rest Api.</p>
  
  <p>It use middleware that protect APi using token.
  When user login from frontend Angular, 'token' generates in backend(laravel) which store in session and send in response. That token is send through each request after login in headers 'Authorization'.</p>
  
  <p>custom controller: LoginController</p>
  
  <pre><code>use Session;
  class LoginController extends Controller
  {
      public function authenticate(Request $request)
      {
          //....validate user login data.....
  
          $token = md5(uniqid(rand(), true));
          Session::put('token', $token);
          // ....send token in response...
      }
  }
  </code></pre>
  
  <p>Middleware: RoleMiddleware</p>
  
  <pre><code>use Session;
  class RoleMiddleware
  {
     public function handle($request, Closure $next)
     {
        $token = Session::get('token');
        //why token appears empty here
         $header = $request-&gt;header('Authorization');
       if($header == $token){
         return $next($request);
       }
  
     }
  </code></pre>
  
  <p>}</p>
  
  <p>Api Route :</p>
  
  <pre><code>Route::post('login', 'Settings\LoginController@authenticate');
  Route::get('users/get/{email}', 'UserController@profile')-&gt;middleware('token');
  </code></pre>
  
  <p>kernel.php : </p>
  
  <pre><code>class Kernel extends HttpKernel
  {
  
    protected $middleware = [
            /////.........
                 ......
                 .....
            \Illuminate\Session\Middleware\StartSession::class,
     ];
  
  
  protected $middlewareGroups = [
      'web' =&gt; [
          \App\Http\Middleware\EncryptCookies::class,
          \Illuminate\Session\Middleware\StartSession::class,
          \Illuminate\Session\Middleware\AuthenticateSession::class,
          \Illuminate\View\Middleware\ShareErrorsFromSession::class,
          \App\Http\Middleware\VerifyCsrfToken::class,
          \Illuminate\Routing\Middleware\SubstituteBindings::class,
      ],
  
      'api' =&gt; [
          \App\Http\Middleware\EncryptCookies::class,
          \Illuminate\Session\Middleware\StartSession::class,
          'throttle:60,1',
          'bindings',
      ],
  ];
  
  /**
   * The application's route middleware.
   *
   * These middleware may be assigned to groups or used individually.
   *
   * @var array
   */
  protected $routeMiddleware = [
      'auth' =&gt; \Illuminate\Auth\Middleware\Authenticate::class,
      'auth.basic' =&gt; \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
      'bindings' =&gt; \Illuminate\Routing\Middleware\SubstituteBindings::class,
      'can' =&gt; \Illuminate\Auth\Middleware\Authorize::class,
      'guest' =&gt; \App\Http\Middleware\RedirectIfAuthenticated::class,
      'throttle' =&gt; \Illuminate\Routing\Middleware\ThrottleRequests::class,
      'token' =&gt; \App\Http\Middleware\RoleMiddleware::class,
  ];
  }
  </code></pre>