title: Why have I to use session_start() to make session persist in Laravel 5.7.28
body: <p>I am trying to create a session in PagesController > designQuote function. The Laravel call to session works but the session does not persist. Here is the code.</p>
  
  <pre><code>Session::push('design_quote_uploads.files', ["Hello"]);
  print_r(Session::all());
  </code></pre>
  
  <p>This works first time but when I comment out the first line <em>design_quote_uploads</em> does not exist in the session vars in the next page load.</p>
  
  <p>The config/Session.php settings is</p>
  
  <pre><code>'driver' =&gt; env('SESSION_DRIVER', 'file'),
  </code></pre>
  
  <p>After reading doc and another answer <a href="https://stackoverflow.com/questions/37615318/laravel-5-2-session-not-persisting">here</a> I checked the Routes and Middleware and it looks like this:</p>
  
  <p>In the web.php the call is:</p>
  
  <pre><code>Route::any('design-quote', 'PageController@designQuote');
  </code></pre>
  
  <p>The middlewareGroups in Kernel.php:</p>
  
  <pre><code>protected $middlewareGroups = [
      'web' =&gt; [
          \App\Http\Middleware\EncryptCookies::class,
          \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
          \Illuminate\Session\Middleware\StartSession::class,
          \Illuminate\View\Middleware\ShareErrorsFromSession::class,
          \App\Http\Middleware\VerifyCsrfToken::class,
          \Illuminate\Routing\Middleware\SubstituteBindings::class,
      ],
  ];
  </code></pre>
  
  <p>If I place <code>session_start();</code> at the top of designQuote method the session persists. Do I have to keep it there?</p>
  
  <p><strong>Edit</strong>: (I swear) Placing <code>session_start()</code> worked yesterday but it is not working today :(</p>
  
  <p>Also the session file at <code>storage/framework/sessions</code> is updated fine every time. I.e. It has data when it is written and misses data when I refresh the page.</p>
  
  <p>I don't know what is missing out there. I checked another <a href="https://stackoverflow.com/questions/37615318/laravel-5-2-session-not-persisting">answer</a> but I didn't understand it fully. It seems like quite old as well. Any help is appreciate.</p>