1234567891011121314151617181920



Question 1: Given an HttpServletRequest request and HttpServletResponse response, which sets
a cookie "username" with the value "joe" in a servlet?

1. request.addCookie("username", "joe")
2. request.setCookie("username", "joe")
3. request.addHeader(new Cookie("username", "joe"))
4. response.addCookie(new Cookie("username", "joe"))