public static void setCookie(HttpServletResponse response, String key, String value){ Cookie cookie = new Cookie(key, value); cookie.setPath("/"); response.addCookie(cookie); }