Cookie userNameCookieRemove = new Cookie("userName", ""); userNameCookieRemove.setMaxAge(0); response.addCookie(userNameCookieRemove);