public static void setCookie(HttpServletRequest request, HttpServletResponse response,
            String name, String value)
    {
        // Save the cookie value for 1 month
        setCookie(request, response, name, value, 60*60*24*30);
    }
Stores a value in a cookie. By default this cookie will persist for 30 days.

@see #setCookie(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,String,String,int)
@param request the servlet request.
@param response the servlet response.
@param name a name to identify the cookie.
@param value the value to store in the cookie.
xmppserver/src/main/java/org/jivesoftware/util/CookieUtils.java