How can a servlet indicate to the browser that cookie data should be sent over a secure connection?
How can a servlet indicate to the browser that cookie data should be sent over a secure connection?
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.
Option A but setSecure(true) not getSecure()