Java HttpCookie setDiscard() MethodThe setDiscard(boolean discard) method of Java HttpCookie class is used to specify whether the given user agent can discard the cookie unconditionally or not. This attribute is RFC 2965 only. SyntaxParameterThe above method consist of only one parameter:
ReturnN.A. Example 1Test it NowOutput: Checks the discard attribute of cookie: false Example 2Test it NowOutput: Checks the discard attribute of the cookie: true Example 3Test it NowOutput: Comment1: Discard attribute is not present. Comment2: Discard attribute is present. Next TopicsetDomain() Method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India