src/SessionManager.php
private function isSessionValid(SessionDataHolder $session, ServerRequestInterface $request):bool
    {
        // if the session is expired
        if (($lastReq = $session->getLastRequestTime())
            && ($lastReq + $this->getExpire() * 60) < time())
        {
            return false;
        }

        // if the client IP changed
        if ($this->getValidateClientIp()
            && ($clientIp = $session->getClientIp())
            && isset($request->getServerParams()['REMOTE_ADDR'])
            && $clientIp != $request->getServerParams()['REMOTE_ADDR'])
        {
            return false;
        }

        return true;
    }
private function isSessionValid(SessionDataHolder $session, ServerRequestInterface $request):bool
    {
        // if the session is expired
        if (($lastReq = $session->getLastRequestTime())
            && ($lastReq + $this->getExpire() * 60) < time())
        {
            return false;
        }

        // if the client IP changed
        if ($this->getValidateClientIp()
            && ($clientIp = $session->getClientIp())
            && isset($request->getServerParams()['REMOTE_ADDR'])
            && $clientIp != $request->getServerParams()['REMOTE_ADDR'])
        {
            return false;
        }

        return true;
    }
private function isSessionValid ( SessionDataHolder $ session , ServerRequestInterface $ request ) : bool { // if the session is expired if ( ( $ lastReq = $ session -> getLastRequestTime ( ) ) && ( $ lastReq + $ this -> getExpire ( ) * 60 ) < time ( ) ) { return false ; } // if the client IP changed if ( $ this -> getValidateClientIp ( ) && ( $ clientIp = $ session -> getClientIp ( ) ) && isset ( $ request -> getServerParams ( ) [ 'REMOTE_ADDR' ] ) && $ clientIp != $ request -> getServerParams ( ) [ 'REMOTE_ADDR' ] ) { return false ; } return true ; }
Verifies if a session is valid

@param SessionDataHolder $session
@param ServerRequestInterface $request
@return bool
Verifies if a session is valid