Java examples for Servlet JSP:Cookie
remove Cookie from HttpServletResponse
import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Main{ public static void removeCookie(HttpServletResponse response, String name) {//ww w. j a va 2s . c o m Cookie cookie = new Cookie(name, ""); cookie.setMaxAge(0); response.addCookie(cookie); } }