You cannot read the session directly from the service provider: in Laravel, the session is processed by StartSession middleware that runs after the service providers download phase
If you want to share the session variable with the entire view, you can use the view composer from your service provider:
public function boot() { view()->composer('*', function ($view) { $view->with('your_var', \Session::get('var') ); }); }
The callback passed as the second argument to the composer will be called when the view is displayed, so the StartSession will already be executed at this point
Moppo source share