code: public Object getSessionAttr(final String attrName) {
      final HttpSession sess = request.getSession(false);
  
      if (sess == null) {
        return null;
      }
  
      return sess.getAttribute(attrName);
    }
docs: Return the value of a named session attribute.
  
  @param attrName    Name of the attribute
  @return Object     Attribute value or null