Top Description Inners Fields Constructors Methods
io.netty.handler.codec.http.cookie

public final Class ClientCookieDecoder

extends CookieDecoder
Class Inheritance
Imports
io.netty.handler.codec.DateFormatter, io.netty.handler.codec.http.cookie.CookieHeaderNames.SameSite, java.util.Date

A RFC6265 compliant cookie decoder to be used client side. It will store the way the raw value was wrapped in Cookie#setWrap(boolean) so it can be eventually sent back to the Origin server as is.
See Also
ClientCookieEncoder

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final ClientCookieDecoder
LAX

Lax instance that doesn't validate name and value

public static final ClientCookieDecoder
STRICT

Strict encoder that validates that name and value chars are in the valid scope defined in RFC6265

Constructor Summary

AccessConstructor and Description
private
ClientCookieDecoder(boolean strict)

Method Summary

Modifier and TypeMethod and Description
public Cookie

Returns:

the decoded Cookie
decode
(String header)

Decodes the specified Set-Cookie HTTP header value into a Cookie.

Inherited from io.netty.handler.codec.http.cookie.CookieDecoder:
initCookie

Field Detail

LAXback to summary
public static final ClientCookieDecoder LAX

Lax instance that doesn't validate name and value

STRICTback to summary
public static final ClientCookieDecoder STRICT

Strict encoder that validates that name and value chars are in the valid scope defined in RFC6265

Constructor Detail

ClientCookieDecoderback to summary
private ClientCookieDecoder(boolean strict)

Method Detail

decodeback to summary
public Cookie decode(String header)

Decodes the specified Set-Cookie HTTP header value into a Cookie.

Returns:Cookie

the decoded Cookie

io.netty.handler.codec.http.cookie back to summary

private Class ClientCookieDecoder.CookieBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty.handler.codec.http.cookie.ClientCookieDecoder.CookieBuilder

Field Summary

Modifier and TypeField and Description
private final DefaultCookie
private String
private int
private int
private final String
private boolean
private long
private boolean
private String
private CookieHeaderNames.SameSite
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
appendAttribute(int
where the key starts in the header
keyStart
,
int
where the key ends in the header
keyEnd
,
int
where the value starts in the header
valueStart
,
int
where the value ends in the header
valueEnd
)

Parse and store a key-value pair.

private String
computeValue(int valueStart, int valueEnd)

pack-priv Cookie
private static boolean
isValueDefined(int valueStart, int valueEnd)

private long
private void
parse11(int nameStart)

private void
parse4(int nameStart, int valueStart, int valueEnd)

private void
parse6(int nameStart, int valueStart, int valueEnd)

private void
parse7(int nameStart, int valueStart, int valueEnd)

private void
parse8(int nameStart, int valueStart, int valueEnd)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cookieback to summary
private final DefaultCookie cookie
domainback to summary
private String domain
expiresEndback to summary
private int expiresEnd
expiresStartback to summary
private int expiresStart
headerback to summary
private final String header
httpOnlyback to summary
private boolean httpOnly
maxAgeback to summary
private long maxAge
partitionedback to summary
private boolean partitioned
pathback to summary
private String path
sameSiteback to summary
private CookieHeaderNames.SameSite sameSite
secureback to summary
private boolean secure

Constructor Detail

CookieBuilderback to summary
pack-priv CookieBuilder(DefaultCookie cookie, String header)

Method Detail

appendAttributeback to summary
pack-priv void appendAttribute(int keyStart, int keyEnd, int valueStart, int valueEnd)

Parse and store a key-value pair. First one is considered to be the cookie name/value. Unknown attribute names are silently discarded.

Parameters
keyStart:int

where the key starts in the header

keyEnd:int

where the key ends in the header

valueStart:int

where the value starts in the header

valueEnd:int

where the value ends in the header

computeValueback to summary
private String computeValue(int valueStart, int valueEnd)
cookieback to summary
pack-priv Cookie cookie()
isValueDefinedback to summary
private static boolean isValueDefined(int valueStart, int valueEnd)
mergeMaxAgeAndExpiresback to summary
private long mergeMaxAgeAndExpires()
parse11back to summary
private void parse11(int nameStart)
parse4back to summary
private void parse4(int nameStart, int valueStart, int valueEnd)
parse6back to summary
private void parse6(int nameStart, int valueStart, int valueEnd)
parse7back to summary
private void parse7(int nameStart, int valueStart, int valueEnd)
parse8back to summary
private void parse8(int nameStart, int valueStart, int valueEnd)
setMaxAgeback to summary
private void setMaxAge(String value)