code: public void setSessionAttr(final String attrName,
                               final Object val) {
      final HttpSession sess = request.getSession(false);
  
      if (sess == null) {
        return;
      }
  
      sess.setAttribute(attrName, val);
    }
docs: Set the value of a named session attribute.
  
  @param attrName    Name of the attribute
  @param val         Object