Java HttpCookie setDomain() MethodThe setDomian(String pattern)method of HttpCookie class is used to specify the domain through which the cookie can be presented. SyntaxParameterThe above method requires only one parameter:
ReturnN.A. Example 1Test it NowOutput: The domain name is given as: www.google.com Example 2Test it NowOutput: The first domain name is given as: www.localhost.com The second domain name is given as: www.google.com Example 3Test it NowOutput: The domain name is given as: null Next TopicsetHttpOnly() 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