code: public void cookie(String domain, String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) {
          Cookie cookie = new Cookie(name, value);
          cookie.setPath(path);
          cookie.setDomain(domain);
          cookie.setMaxAge(maxAge);
          cookie.setSecure(secured);
          cookie.setHttpOnly(httpOnly);
          response.addCookie(cookie);
      }
docs: Adds cookie to the response. Can be invoked multiple times to insert more than one cookie.
  
  @param domain   domain of the cookie
  @param path     path of the cookie
  @param name     name of the cookie
  @param value    value of the cookie
  @param maxAge   max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie)
  @param secured  if true : cookie will be secured
  @param httpOnly if true: cookie will be marked as http only