code: public Object put(String name, Serializable value){
          Object val = RequestContext.getHttpRequest().getSession(true).getAttribute(name);
          RequestContext.getHttpRequest().getSession(true).setAttribute(name, value);
          return val;
      }
docs: Add object to a session.
  @param name name of object
  @param value object reference.