docs: protected CmsObject registerSession(HttpServletRequest request, CmsObject cms) throws CmsException {
  
          if (!cms.getRequestContext().getCurrentUser().isGuestUser()) {
              // make sure we have a new session after login for security reasons
              HttpSession session = request.getSession(false);
              if (session != null) {
                  session.invalidate();
              }
              session = request.getSession(true);
          }
  
          // update the request context
          cms = OpenCmsCore.getInstance().updateContext(request, cms);
  
          CmsUser user = cms.getRequestContext().getCurrentUser();
          if (!user.isGuestUser() && !OpenCms.getDefaultUsers().isUserExport(user.getName())) {
              // create the session info object, only for 'real' users
              CmsSessionInfo sessionInfo = new CmsSessionInfo(
                  cms.getRequestContext(),
                  new CmsUUID(),
                  request.getSession().getMaxInactiveInterval());
              // register the updated cms object in the session manager
              OpenCmsCore.getInstance().getSessionManager().addSessionInfo(sessionInfo);
          }
          // return the updated cms object
          return cms;
      }