Top Description Methods
org.apache.hc.client5.http.cookie

public Interface CookieAttributeHandler

Known Direct Subinterfaces
org.apache.hc.client5.http.cookie.CommonCookieAttributeHandler
Known Direct Implementers
org.apache.hc.client5.http.impl.cookie.AbstractCookieAttributeHandler
Annotations
@Contract
threading:STATELESS
Imports
org.apache.hc.core5.annotation.Contract, .ThreadingBehavior

This interface represents a cookie attribute handler responsible for parsing, validating, and matching a specific cookie attribute, such as path, domain, port, etc.

Different cookie specifications can provide a specific implementation for this class based on their cookie handling rules.

Since
4.0

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the match is successful; false otherwise
match
(Cookie cookie, CookieOrigin
the cookie source to match against
origin
)

Matches the given value (property of the destination host where request is being submitted) with the corresponding cookie attribute.

public void
parse(SetCookie cookie, String
cookie attribute value from the cookie response header
value
)

Parse the given cookie attribute value and processChallenge the corresponding org.apache.hc.client5.http.cookie.Cookie property.

public void
validate(Cookie cookie, CookieOrigin
the cookie source to validate against
origin
)

Performs cookie validation for the given attribute value.

Method Detail

matchback to summary
public boolean match(Cookie cookie, CookieOrigin origin)

Matches the given value (property of the destination host where request is being submitted) with the corresponding cookie attribute.

Parameters
cookie:Cookie

org.apache.hc.client5.http.cookie.Cookie to match

origin:CookieOrigin

the cookie source to match against

Returns:boolean

true if the match is successful; false otherwise

parseback to summary
public void parse(SetCookie cookie, String value) throws MalformedCookieException

Parse the given cookie attribute value and processChallenge the corresponding org.apache.hc.client5.http.cookie.Cookie property.

Parameters
cookie:SetCookie

org.apache.hc.client5.http.cookie.Cookie to be updated

value:String

cookie attribute value from the cookie response header

Exceptions
MalformedCookieException:
if cookie parsing fails for this attribute
validateback to summary
public void validate(Cookie cookie, CookieOrigin origin) throws MalformedCookieException

Performs cookie validation for the given attribute value.

Parameters
cookie:Cookie

org.apache.hc.client5.http.cookie.Cookie to validate

origin:CookieOrigin

the cookie source to validate against

Exceptions
MalformedCookieException:
if cookie validation fails for this attribute