Hard to say without seeing your code. My guess is to have a method that handles all ajax calls and redirects if it gets an error that the user is signed out
How to handle session expired on ajax request (302 Found) Laravel 8
Hello my dears,
Laravel Framework 8.83.16
I have an application that controls the sessions by file.
And when a session ends and the user is still on the page and makes an ajax request, in the return on the ajax request I get a 302 Found with redirection to the login screen, but the browser is not redirecting automatically, it returns another ajax request with the login screen.
For me this behavior is useless, I need that if you receive the 302 effectively redirect to the login screen.
I already tried this through middle that I keep getting the same problem with 302 and I already tried to do it with setInterval checking the session that also returned the 302.
How can I adjust this so that any ajax requests after the session expired are effectively redirected to the login screen?
Please or to participate in this conversation.