#Redirect user to sign in page when session expires
12 messages · Page 1 of 1 (latest)
Don't know exactly how you can run it every minute, but I made something pretty similar using a custom middleware. Check this: https://laravel.com/docs/11.x/middleware#global-middleware. You would have to check your user's session every time that he/she made a HTTP request.
I think Laravel executes the middlewares in the order that you define them though, so pay attention to the order you will put your custom middleware so it doesn't cause any trouble with the native ones
Making a request would just be keeping the session alive tho
You should be able to do it at the route level, so you protect your main pages, if they aren't logged in they go to the sign in page
the Auth::Route will support this functionality as a default func.
Indeed that will keep the session alive...
How?
Just use an Auth route so they can only access when logged in
You can set the redirect page to what you need it to be
I want them to get redirected to the login page without having to click anywhere