851 0 0 0
Last Updated : 2025-04-29 00:59:31
When user logged-in and remains inactive , they can be logged out after a period of time . so this snippet will teach you this
you can change the time period for an idle session to expire in the /app/config/session.php
file.
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 15), // set inactivity time in env file at SESSION_LIFETIME first and determine default time here so replace 15 to what minutes you want
'expire_on_close' => false, //if you set this to true , the session will expire when browser is closed