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
|