code: public void addCookie(String name, String value, HttpServletResponse response) {
          Cookie cookie = new Cookie(name, value);
          cookie.setHttpOnly(httpOnly);
          cookie.setSecure(secure);
          if (StringUtils.isNotEmpty(domain)) {
              cookie.setDomain(domain);
          }
          if (StringUtils.isNotEmpty(path)) {
              cookie.setPath(path);
          }
          if (maxAge != null) {
              cookie.setMaxAge(maxAge);
          }
  
          response.addCookie(cookie);
  
          logger.debug(LOG_KEY_ADDED_COOKIE, name);
      }
docs: Add a new cookie, using the configured domain, path and max age, to the response.
  
  @param name  the name of the cookie
  @param value the value of the cookie