Exam 1z0-900 All QuestionsBrowse all questions from this exam
Question 42

How can a servlet indicate to the browser that cookie data should be sent over a secure connection?

    Correct Answer: D

    To ensure that cookie data is sent over a secure connection, a servlet must use the setSecure(true) method on the Cookie object. However, setting the SessionTrackingMode.SSL on the ServletContext object provides a more comprehensive approach by ensuring that all session tracking data is transmitted over SSL. This method configures the servlet context to exclusively use secure connections for session tracking.

Discussion
orjavaOption: A

Option A but setSecure(true) not getSecure()