UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_40c3d5361388
/
app
/
Http
/
Middleware
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
SessionTimeout.php
<?php namespace EstudioLMS\Http\Middleware; use Closure; use Illuminate\Contracts\Auth\Guard; use Symfony\Component\HttpFoundation\Session\SessionInterface; class SessionTimeout { protected $session; protected $timeout = 1200; /** * @var Guard */ private $auth; /** * SessionTimeout constructor. * @param SessionInterface $session * @param Guard $auth */ public function __construct(SessionInterface $session, Guard $auth) { $this->session = $session; $this->auth = $auth; } /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if($this->auth->check()) { if (!$this->session->has('lastActivityTime')) { $this->session->put('lastActivityTime', time()); } elseif (time() - $this->session->get('lastActivityTime') > $this->getTimeOut()) { $this->session->forget('lastActivityTime'); $this->auth->logout(); $this->session->clear(); if ($this->getTimeOut() >= 60) { $timeout = $this->getTimeOut() / 60; return redirect('/auth')->withErrors(trans('messages.lblTimeout', ['timeout' => $timeout, 'measure' => 'minuto(s)'])); } else { return redirect('/auth')->withErrors(trans('messages.lblTimeout', ['timeout' => $this->getTimeOut(), 'measure' => 'segundos'])); } } $this->session->put('lastActivityTime', time()); } return $next($request); } protected function getTimeOut() { return (env('TIMEOUT')) ?: $this->timeout; } }
Copyright © 2026 - UnknownSec