code: public static void failureCookie(HttpServletRequest request, HttpServletResponse response,
              String name, String domain,String contextPath) {
          if (request != null && response != null) {
              addCookie(request, response, name, null, domain, contextPath, 0,true);
          }
      }
docs: failure a cookie