/**
  * Stores the data of the passed request in the also passed session.
  *
  * @param \AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest The servlet request instance
  * @param \AppserverIo\Psr\Servlet\Http\HttpSessionInterface        $session        The session instance
  *
  * @return void
  */
 protected function saveRequest(HttpServletRequestInterface $servletRequest, HttpSessionInterface $session)
 {
     // initialize an empty instance
     $req = new \stdClass();
     // set the data of the passed request
     $req->requestUri = $servletRequest->getRequestUri();
     $req->method = $servletRequest->getMethod();
     $req->queryString = $servletRequest->getQueryString();
     $req->documentRoot = $servletRequest->getDocumentRoot();
     $req->serverName = $servletRequest->getServerName();
     $req->bodyContent = $servletRequest->getBodyContent();
     $req->cookies = $servletRequest->getCookies();
     $req->headers = $servletRequest->getHeaders();
     $req->principal = $servletRequest->getUserPrincipal();
     $req->requestUrl = $servletRequest->getRequestUrl();
     // store the data in the session
     $session->putData(Constants::FORM_REQUEST, $req);
 }