What are setSecure() and getSecure() methods in Cookies?



What are setSecure() and getSecure() methods in Cookies?..

Answer / harikrishna ravada

setSecure:

Indicates to the user agent that the cookie should only be
sent using a secure protocol (https). This should only be
set when the cookie's originating server used a secure
protocol to set the cookie's value.

public void setSecure(boolean flag)

getSecure:

Returns the value of the 'secure' flag.

public boolean getSecure()

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Servlets Interview Questions

What is the requirement of servlet config and servlet context implemented and how are they implemented?

1 Answers  


What is a web application and what is it’s directory structure?

1 Answers  


Explain mvc pattern.

1 Answers  


What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?

1 Answers  


Why do we have servlet wrapper classes?

1 Answers  


What is servlet context ?

4 Answers  


Can we refresh servlet in client and server side automatically?

1 Answers  


What is URL Encoding?

1 Answers  


How to get the server information in a servlet?

1 Answers  


how to pass parameter from servlet to html form

4 Answers  


What is context in servlet?

1 Answers  


Explain the features are in servlet 3?

1 Answers  


Categories