code: public String[] names(){
          List<String> namesList = new ArrayList<String>();
          Enumeration<String> names = session.getAttributeNames();//request.getSession(true).getAttributeNames();
          if (names == null) return null;
          while (names.hasMoreElements()) {
              Object o = names.nextElement();
              namesList.add(o.toString());
          }        
          return namesList.toArray(new String[namesList.size()]);
      }
docs: Returns names of current attributes as a list.
  
  @return names of current attributes as a list.