laravel logout on session expire code example
Example 1: auto logout when session expires laravel
class LoginController extends Controller
{
// ...
protected function authenticated(Request $request, $user)
{
$user->last_seen_at = Carbon::now()->format('Y-m-d H:i:s');
$user->save();
}
}
Example 2: auto logout when session expires laravel
# Session lifetime in minutes
SESSION_LIFETIME=10