Online Java Compiler By
JavaTpoint.com
import java.net.HttpCookie; public class JavaHttpCookieGetSecureExample1 { public static void main(String[] args) { HttpCookie cookie = new HttpCookie("Emplyee", "101"); cookie.setSecure(false); // Return false if the cookie can 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