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 does tomcat servlet container work?

0 Answers  


Which event is fired at the time of project deployment and undeployment?

0 Answers  


Describe some assignments that are executed by servlet container?

0 Answers  


How to invoke a Servlet?

2 Answers   Mastek,


explain filters in java?

2 Answers   TCS,


Which java framework is most popular?

0 Answers  


Explain the role of dispatcherservlet and contextloaderlistener.

0 Answers  


How do servlets work?

0 Answers  


How the JSP file will be executed on the Server side?

0 Answers   Cap Gemini,


What is the procedure for initializing a servlet?

0 Answers  


What are the different methods involved in generic servlet?

0 Answers  


What is a cookie What is the difference between session and cookie

0 Answers  


Categories