Online Java Compiler By
JavaTpoint.com
import java.net.HttpCookie; public class JavaHttpCookieGetSecureExample2 { public static void main(String[] args) { HttpCookie cookie = new HttpCookie("Emplyee", "101"); cookie.setSecure(true); // Return true if the cookie can not be sent by any other standard protocol. System.out.println("Tests whether the cookie can be sent through secured protocol or not: "+cookie.getSecure()); } }
Output