I am running a laravel based website and using bugsnag for bug tracking.
a lot of time i get bug with "Illuminate\Session\TokenMismatchException"
its because people opened login page long back and entered details now,
but showing error page is pretty awkward, so how can i display a nice message instead of that?
@lorvent in the docs' section I linked you will find exactly what you need - handling errors. Use this and handle TokenMismatchException the way you'd like the app to respond to the user, ie. show some view with helpful notice or whatever.
If we redirect visitor to login page because of TokenMismatchException....
whenever i create a form without token or send ajax request.... page will be redirected to login page.