Java java.net HttpCookie fields, constructors, methods, implement or subclass

Example usage for Java java.net HttpCookie fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.net HttpCookie.

The text is from its open source code.

Constructor

HttpCookie(String name, String value)
Constructs a cookie with a specified name and value.

Method

Objectclone()
Create and return a copy of this object.
booleandomainMatches(String domain, String host)
The utility method to check whether a host name is in a domain or not.
StringgetComment()
Returns the comment describing the purpose of this cookie, or null if the cookie has no comment.
StringgetCommentURL()
Returns the comment URL describing the purpose of this cookie, or null if the cookie has no comment URL.
booleangetDiscard()
Returns the discard attribute of the cookie
StringgetDomain()
Returns the domain name set for this cookie.
longgetMaxAge()
Returns the maximum age of the cookie, specified in seconds.
StringgetName()
Returns the name of the cookie.
StringgetPath()
Returns the path on the server to which the browser returns this cookie.
StringgetPortlist()
Returns the port list attribute of the cookie
booleangetSecure()
Returns true if sending this cookie should be restricted to a secure protocol, or false if the it can be sent using any protocol.
StringgetValue()
Returns the value of the cookie.
intgetVersion()
Returns the version of the protocol this cookie complies with.
booleanhasExpired()
Reports whether this HTTP cookie has expired or not.
inthashCode()
Returns the hash code of this HTTP cookie.
booleanisHttpOnly()
Returns true if this cookie contains the HttpOnly attribute.
Listparse(String header)
Constructs cookies from set-cookie or set-cookie2 header string.
voidsetComment(String purpose)
Specifies a comment that describes a cookie's purpose.
voidsetCommentURL(String purpose)
Specifies a comment URL that describes a cookie's purpose.
voidsetDiscard(boolean discard)
Specify whether user agent should discard the cookie unconditionally.
voidsetDomain(String pattern)
Specifies the domain within which this cookie should be presented.
voidsetHttpOnly(boolean httpOnly)
Indicates whether the cookie should be considered HTTP Only.
voidsetMaxAge(long expiry)
Sets the maximum age of the cookie in seconds.
voidsetPath(String uri)
Specifies a path for the cookie to which the client should return the cookie.
voidsetPortlist(String ports)
Specify the portlist of the cookie, which restricts the port(s) to which a cookie may be sent back in a Cookie header.
voidsetSecure(boolean flag)
Indicates whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL.
voidsetValue(String newValue)
Assigns a new value to a cookie after the cookie is created.
voidsetVersion(int v)
Sets the version of the cookie protocol this cookie complies with.
StringtoString()
Constructs a cookie header string representation of this cookie, which is in the format defined by corresponding cookie specification, but without the leading "Cookie:" token.