I am using Laravel 5.7. For security reasons, I set my laravel application to automatically logout after one hour inactivity. But I want the user log back in the same page before they got kicked out by the system. I try to use Session, but it only store previous url which is the login page url. How can I retrieve that URL before user got automatically logout?
Using session to reach previous page after login in laravel
1.5k views Asked by dlfjj At
2
All you need to do is put this in your logout function.
And then on login function, redirect user to
session('returnUrl')
and delete session data withsession()->forget('returnUrl')