Engineering Full Stack Apps with Java and JavaScript
Given an HttpServletRequest request and HttpResponse response, which sets a cookie “username” with the value “john” in a servlet?
A. request.addCookie("username", "john")
B. request.setCookie("username", "john")
C. response.addCookie("username", "john")
D. request.addHeader(new Cookie("username", "john"))
E. request.addCookie(new Cookie("username", "john"))
F. response.addCookie(new Cookie("username", "john"))
G. response.addHeader(new Cookie("username", "john"))