Package com.teamdev.jxbrowser.cookie
Interface Cookie
public interface Cookie
An HTTP cookie.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault TimestampReturns the cookie creation time since UNIX epoch.default Stringdomain()Returns a string that represents the domain name of this cookie, or an empty string if the domain name for this cookie is not specified.default TimestampReturns the cookie expiration time since UNIX epoch.default booleanReturnstrueif the cookie is considered HTTP only.default booleanisSecure()Returnstrueif the cookie is restricted to a secure protocol (HTTPS or WSS) orfalseif it can be sent using any protocol.default Stringname()Returns a string that represents the name of this cookie, or an empty string if the cookie name is not specified.static Cookie.BuildernewBuilder(String domain) Creates a newCookiebuilder.default Optional<PartitionKey>Returns the partition key if the cookie has the independent partitioned state.default Stringpath()Returns a string that represents the path that must exist in the URL of a request in order to send this cookie to the server.default SameSitesameSite()Returns the SameSite cookie attribute value.default Stringvalue()Returns a string that represents the value of this cookie, or an empty string if the cookie value is not specified.
-
Method Details
-
newBuilder
Creates a newCookiebuilder.- Parameters:
domain- a domain this cookie belongs to. Please note, the domain is also required for cookies with__Hostprefix.- Returns:
- a new
Cookie.Builderinstance - Throws:
IllegalArgumentException- if thedomainis blank or empty
-
name
Returns a string that represents the name of this cookie, or an empty string if the cookie name is not specified.- Returns:
- the name of this cookie
-
value
Returns a string that represents the value of this cookie, or an empty string if the cookie value is not specified.- Returns:
- the value of this cookie or an empty string
-
domain
Returns a string that represents the domain name of this cookie, or an empty string if the domain name for this cookie is not specified.- Returns:
- the domain name of this cookie or an empty string
-
path
Returns a string that represents the path that must exist in the URL of a request in order to send this cookie to the server. -
isSecure
default boolean isSecure()Returnstrueif the cookie is restricted to a secure protocol (HTTPS or WSS) orfalseif it can be sent using any protocol. -
isHttpOnly
default boolean isHttpOnly()Returnstrueif the cookie is considered HTTP only. It means that the cookie contains theHttpOnlyattribute and should not be accessible from JavaScript. -
creationTime
Returns the cookie creation time since UNIX epoch. The returned value equals the number of milliseconds since January 1, 1970. -
expirationTime
Returns the cookie expiration time since UNIX epoch. The returned value equals the number of milliseconds since January 1, 1970. ReturnsTimestamp.NONEfor session cookies. -
sameSite
Returns the SameSite cookie attribute value. -
partitionKey
Returns the partition key if the cookie has the independent partitioned state. Otherwise, returnsOptional.empty()Partitioned cookies are
Securecookies with thePartitionedattribute that can be set in another embedded frame context.- Since:
- 7.40.0
-