Regarding your first question: the config/session.php has a 'lifetime' setting (overridable by the .env file setting, which has a setting for 'Session Timeout' (typically 120 minutes)).
You can use Auth::check() in your middleware to see if the session expired, and if so you can redirect back to the 'Login' page.
This link shows you how to use it https://laravel.io/forum/09-10-2015-l5-detect-session-expiration
Look at SynRJ's reply
Regarding your 2nd question, I am unable to help.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…