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

How many ways are available to ger RequestDispatcher object?

4 Answers   Polaris,


What are the types of servlets? Explain

0 Answers  


What are the advantages of Servlet over CGI?

0 Answers  


Explain session tracking and its importance?

0 Answers  


Which interface should be implemented by all servlets?

0 Answers  






How to commuincate between an applet and a servlet?

0 Answers  


What is the main purpose of java servlets?

0 Answers  


Is tomcat a servlet container?

0 Answers  


Are Servlets by default thread safe or not? thanks in advance regards Sudhakar

3 Answers  


Is JSP Thread Safe ???? How To make JSP thrad safe ?????

6 Answers   Cognizant,


What are different Authentication options available in Servlets.

0 Answers  


What is ServletContext() and what is its use?

9 Answers   Prime Technology, TCS,


Categories