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 Generic Servlet and how it is different from Http Servlet?

5 Answers   Wipro,


What is the major difference between servlet and applet?

0 Answers  


Explain is servlet mapping?

0 Answers  


What do you mean by cgi?

0 Answers  


Define servlet mapping?

0 Answers  


What is java servlet?

0 Answers  


Difference between get and post in java servlets?

0 Answers  


What is the difference between encodeRedirectUrl and encodeURL?

0 Answers  


What do you mean by filter in servlet?

0 Answers  


Is there any differance b/w getting servlet context from servlet config and session? if yes then what is that?

7 Answers  


Why do we need a constructor in a servlet if we use the init method?

0 Answers  


How many ways are available to ger RequestDispatcher object?

4 Answers   Polaris,


Categories