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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is init() method is used in servlets?

562


How to notify an object in session when session is invalidated or timed-out?

642


Explain session tracking and its importance?

554


How can we achieve transport layer security for our web application?

583


Can a jsp be called using a servlet?

590






What is the element?

596


Why do we have servlet filters?

612


How are filters?

595


Explain the difference between generic servlet and http servlet?

548


What is the type of method for sending request from http server?

606


What is the disadvantage of cookies?

588


What are the difference between RMI and Servlets?

1059


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

798


How do I know if java is running on linux?

609


When servlet object is created?

613