AppserverIo\Appserver\ServletEngine\Authenticator\FormAuthenticator::onCache PHP Method

onCache() protected method

Will be invoked to handle a cached authentication request.
protected onCache ( AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest, AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse ) : void
$servletRequest AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The servlet request instance
$servletResponse AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface The servlet response instance
return void
    protected function onCache(HttpServletRequestInterface $servletRequest, HttpServletResponseInterface $servletResponse)
    {
        // load the session from the request
        if ($session = $servletRequest->getSession()) {
            // add the user principal and the authentication type to the request
            $this->register($servletRequest, $servletResponse, $session->getData(Constants::PRINCIPAL));
        }
    }