code: public static void addCookie(HttpServletRequest request, HttpServletResponse response, String name,
        String value, int age) {
      String contextPath = request.getContextPath();
      if (!contextPath.endsWith("/")) {
        contextPath += "/";
      }
      addCookie(request, response, name, value, contextPath, age);
    }
docs: 默认按照应用上下文进行设置
  
  @param request
  @param response
  @param name
  @param value
  @param age
  @throws Exception