title: Cant access session in constructor Laravel 5.6
body: <p>My function is here, <code>var_dump</code> is returns <code>null</code></p>
  
  <pre><code>public function __construct() {
  
  var_dump(session('cart'));
  
  $this-&gt;cart = session('cart');
  $this-&gt;payment = session('payment');
  $this-&gt;coupon = session('coupon');
  
  $this-&gt;currency = \App\Setting::where('key','eur_currency')-&gt;first()-&gt;value;
  
  if (!isset($this-&gt;cart["items"])) {
    $cart = ['items' =&gt; [],'total' =&gt; 0, 'sub_total' =&gt; 0,'try' =&gt; 0];
    session(['cart' =&gt; $cart]);
    $this-&gt;cart = session('cart');
  } 
  ....
  ....
  ....
  </code></pre>
  
  <p>How can i access sessions in <code>__constructor</code> method?</p>
  
  <p>Edit: Thanks for @devk, my method working now.</p>
  
  <pre><code>public function __construct() {
  $this-&gt;middleware(function ($request, $next) {
    $this-&gt;cart = session('cart');
    $this-&gt;payment = session('payment');
    $this-&gt;coupon = session('coupon');
  
    $this-&gt;currency = \App\Setting::where('key','eur_currency')-&gt;first()-&gt;value;
  
    if (!isset($this-&gt;cart["items"])) {
      $cart = ['items' =&gt; [],'total' =&gt; 0, 'sub_total' =&gt; 0,'try' =&gt; 0];
      session(['cart' =&gt; $cart]);
      $this-&gt;cart = session('cart');
    }
  
  
    if (!isset($this-&gt;coupon["applied"])) {
      $coupon = ['applied' =&gt; false,'code' =&gt; null,'type' =&gt; null, 'value' =&gt; null];
      session(['coupon' =&gt; $coupon]);
      $this-&gt;coupon = session('coupon');
    }
  
    if (!isset($this-&gt;payment["payment_type"])) {
      $payment = ['payment_type' =&gt; 'CC', 'invoice_type' =&gt; 'PERSONAL',   'invoice' =&gt; [ 'fullname' =&gt; '','email' =&gt; '','company' =&gt; '','tax_office' =&gt; '','tax_id' =&gt; '' ]];
      session(['payment' =&gt; $payment]);
      $this-&gt;payment = session('payment');
    }
  
    return $next($request);
  });
  </code></pre>
  
  <p>}</p>