code: @SuppressWarnings("unchecked")
      public static <T> T getSessionAttribute(final HttpSession session, final String key) {
          if (session != null) {
              return (T) session.getAttribute(key);
          }
          return null;
      }
docs: Returns a session attribute as the type of object stored.
  
  @param session session where the attribute is stored
  @param key the attributes key
  @param <T> the type of object expected
  @return the requested object
  @since 1.0.0