code: public CmsSessionInfo getSessionInfo(HttpServletRequest req) {
  
          HttpSession session = req.getSession(false);
          if (session == null) {
              // special case for accessing a session from "outside" requests (e.g. upload applet)
              String sessionId = req.getHeader(CmsRequestUtil.HEADER_JSESSIONID);
              return sessionId == null ? null : getSessionInfo(sessionId);
          }
          return getSessionInfo(session);
      }
docs: Returns the OpenCms user session info for the given request,
  or <code>null</code> if no user session is available.<p>
  
  @param req the current request
  
  @return the OpenCms user session info for the given request, or <code>null</code> if no user session is available