Java HttpCookie getSecure() Method

The getSecure() method of Java HttpCookie class is used to return true if sending the cookie through a secure protocol is restricted. Otherwise, the method may return true so that it can be sent using any protocol.

Syntax

Parameter

N.A.

Return

The above method is used to return false if the cookie can be sent by any other standard protocol. Otherwise, the method may return true.

Example 1

Test it Now

Output:

Tests whether the cookie can be sent through secured protocol or not: false

Example 2

Test it Now

Output:

Tests whether the cookie can be sent through secured protocol or not: true




Latest Courses