get("AppsToken"); if ($appsToken != null){ $lastIdleTime = session()->get("lastIdleTime"); if ($lastIdleTime == null){ session()->put('lastIdleTime', time()); }else{ if (time() - $lastIdleTime > 60){ session()->forget("lastIdleTime"); return redirect("/"); } } }else{ $request->session()->flush(); return redirect('/login'); } // return $next($request); $response = $next($request); return $response->header('Cache-Control','no-cache, no-store, max-age=0, must-revalidate') ->header('Pragma','no-cache') ->header('Expires','Sun, 02 Jan 1990 00:00:00 GMT'); } }