Session expiration probably means that the user is logged out. In this case you can specify middleware on your routes that will redirect users if the route requires you to be logged in. That will redirect them to auth/ pages but user will not see any notification. You can of course edit your app/Http/Middleware/Authenticate file, @handle method and use
Session::put('message', 'You need to be logged in');
And on your auth/login page use
echo Session::get('message');
Hey, thank you for your answer. I added this at the beginning of the @handle method in the Authenticate middleware :
if (!Auth::check()) {
Session::flash('message', trans('errors.session_label'));
Session::flash('type', 'warning');
return redirect()->route('home');
}
Don't know if there's a better way, but it works, thanks !
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community