Class ClientCookieEncoder
java.lang.Object
org.jboss.netty.handler.codec.http.cookie.CookieEncoder
org.jboss.netty.handler.codec.http.cookie.ClientCookieEncoder
A RFC6265 compliant cookie encoder to be used client side,
so only name=value pairs are sent.
User-Agents are not supposed to interpret cookies, so, if present,
will be used.
Otherwise,
invalid reference
Cookie#rawValue()
Cookie.value() will be used unquoted.
Note that multiple cookies are supposed to be sent at once in a single "Cookie" header.
// ExampleHttpRequestreq = ...; res.setHeader("Cookie",ClientCookieEncoder.encode("JSESSIONID", "1234"));
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClientCookieEncoderLax instance that doesn't validate name and valuestatic final ClientCookieEncoderStrict encoder that validates that name and value chars are in the valid scope defined in RFC6265 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEncodes the specified cookies into a single Cookie header value.private voidencode(StringBuilder buf, Cookie c) Encodes the specified cookie into a Cookie header value.Encodes the specified cookie into a Cookie header value.Encodes the specified cookies into a single Cookie header value.Methods inherited from class CookieEncoder
validateCookie
-
Field Details
-
STRICT
Strict encoder that validates that name and value chars are in the valid scope defined in RFC6265 -
LAX
Lax instance that doesn't validate name and value
-
-
Constructor Details
-
ClientCookieEncoder
private ClientCookieEncoder(boolean strict)
-
-
Method Details
-
encode
-
encode
-
encode
-
encode
-
encode
-