Javatpoint Logo
Javatpoint Logo

Java HttpCookie getDomain() Method

The getDomain() method of HttpCookie class is invoked to return the domain name set for the given cookie. The general form of the domain is set by RFC 2965.

Syntax

Parameter

N.A.

Return

The above method is used to return a string which contains the domain name.

Example 1

Test it Now

Output:

The domain name is given as: www.google.com

Example 2

Test it Now

Output:

The first domain name is given as: www.google.com
The second domain name is given as: www.javatpoint.com

Example 3

Test it Now

Output:

The domain name is given as:  null
Next TopicgetMaxAge() Method





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA