// ExampleHttpResponseres = ...; res.setHeader("Set-Cookie",ServerCookieEncoder.encode("JSESSIONID", "1234"));
ServerCookieDecoder
| Modifier and Type | Field and Description |
|---|---|
| public static final ServerCookieEncoder | LAX
Lax instance that doesn't validate name and value, and that allows multiple cookies with the same name. |
| public static final ServerCookieEncoder | STRICT
Strict encoder that validates that name and value chars are in the valid scope defined in RFC6265, and (for methods that accept multiple cookies) that only one cookie is encoded with any given name. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static List | Returns: The encoded list with all but the last instance of a named cookie.The list of encoded cookies. encoded, Map<String, Integer> A map from cookie name to index of last cookie instance. nameToLastIndex)Deduplicate a list of encoded cookies by keeping only the last instance with a given name. |
| public String | |
| public String | |
| public List | |
| public List | Returns: the corresponding bunch of Set-Cookie headersa bunch of cookies cookies)Batch encodes cookies into Set-Cookie header values. |
| public List |
| LAX | back to summary |
|---|---|
| public static final ServerCookieEncoder LAX Lax instance that doesn't validate name and value, and that allows multiple cookies with the same name. | |
| STRICT | back to summary |
|---|---|
| public static final ServerCookieEncoder STRICT Strict encoder that validates that name and value chars are in the valid scope defined in RFC6265, and (for methods that accept multiple cookies) that only one cookie is encoded with any given name. (If multiple cookies have the same name, the last one is the one that is encoded.) | |
| ServerCookieEncoder | back to summary |
|---|---|
| private ServerCookieEncoder(boolean strict) | |
| dedup | back to summary |
|---|---|
| private static List Deduplicate a list of encoded cookies by keeping only the last instance with a given name. | |
| encode | back to summary |
|---|---|
| public String encode(String name, String value) Encodes the specified cookie name-value pair into a Set-Cookie header value. | |
| encode | back to summary |
|---|---|
| public String encode(Cookie cookie) Encodes the specified cookie into a Set-Cookie header value. | |
| encode | back to summary |
|---|---|
| public List Batch encodes cookies into Set-Cookie header values. | |
| encode | back to summary |
|---|---|
| public List Batch encodes cookies into Set-Cookie header values.
| |
| encode | back to summary |
|---|---|
| public List Batch encodes cookies into Set-Cookie header values. | |