b. <input type=”text area” name=”lastName” value=”Smith”>
c. <input type=”radio” name=”lastName” value=”Smith”>
d. <input type=”checkbox” name=”lastName” value=”Smith”>
e. <input type=”hidden” name=”lastName” value=”Smith”>
#
37. To create a cookie for lastName with value Smith, use .
a. new Cookie(“Smith”, “lastName”);
b. new Cookie(Smith, lastName);
c. new Cookie(“lastName”, “Smith”);
d. new Cookie(lastName, \Smith);
#
38. Suppose the two parameters in the doGet or doPost method are request and response. To send a cookie to a client,
use .
a. response.addCookie(cookie)
b. response.sendCookie(cookie)
c. request.addCookie(cookie)
d. request.sendCookie(cookie)
#
39. Suppose the two parameters in the doGet or doPost method are request and response. To retrieve a cookie from a
client, use .
a. response.retrieveCookie()
b. response.getCookie()
c. You have to use request.getCookies() to obtain all cookies in an array
d. You have to use request.getCookie() to obtain a cookie
#
40. For an instance of Cookie, say cookie, to retrieve the name of the cookie, use .
a. cookie.getValue()
b. cookie.getName()
c. You have to use cookie.getNames() to obtain all values in an array.
d. You have to use cookie.getValues() to obtain all values in an array.
#
41. By default, how long does a cookie last?
a. 24 hours
b. 30 days
c. 365 days
d. By default, a newly created cookie persists until the browser exits.
#
37. Suppose the two parameters in the doGet or doPost method are request and response. To create an HTTP session,
use .
a. request.createSession()
b. request.getSession()
c. response.createSession()