code: public FilterGlobals getGlobals(final HttpServletRequest req) {
      HttpSession sess = req.getSession();
  
      if (sess == null) {
        // We're screwed
        return null;
      }
  
      Object o = sess.getAttribute(globalsName);
      FilterGlobals fg;
  
      if (o == null) {
        fg = newFilterGlobals();
        sess.setAttribute(globalsName, fg);
  
        if (debug()) {
          debug("Created new FilterGlobals from session " + sess.getId());
        }
      } else {
        fg = (FilterGlobals)o;
        //if (debug()) {
        //  getLogger().debug("Obtained FilterGlobals from session with id " +
        //                    sess.getId());
        //}
      }
  
      return fg;
    }
docs: Get the globals from the session
  
  @param req
  @return globals object