I have dashboard controller in laravel..once the user login i'm saving the userId in session ..every function i have to access the session variable userId..I would like to store the session value in my constructor variable..

```
protected $users;

protected $session;

protected $userId;

public function __construct(Users $users,Session $session){  
       $this->users      = $users;
       $this->session    = $session;
       if($this->session->has('userId)){
         $this->userId = $this->session->get('userId);
       }
}

public function login(){
    // After success saving userId in session and assing like as below
     $this->userId = $response['id'];
}

public function dashboard(){
  echo $this->userId; // Is empty
}

```

What is the solution or how to use this ?