Utility methods for server-side HTTP cookie handling.
| Modifier and Type | Class and Description |
|---|---|
| public static class | HttpCookieUtils.SetCookieHttpField
A |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final Index | |
| public static final String | SAME_SITE_DEFAULT_ATTRIBUTE
Name of context attribute with default SameSite cookie value |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static HttpCookie | Returns: either the original cookie, or a new one that has the samesit default setthe cookie to check cookie, Attributes the context to check settings attributes)Check that samesite is set on the cookie. |
| public static String | |
| public static String | |
| public static HttpCookie. | Returns: the default SameSite value or null if one does not existthe context to check for default SameSite value contextAttributes)Get the default value for SameSite cookie attribute, if one has been set for the given context. |
| public static String | |
| private static boolean | Returns: whether the text needs to be quotedthe text to check text)Whether a cookie name/value/attribute needs to be quoted. |
| public static boolean | Returns: true if all of the name, domain and path match the Set-Cookie header, false otherwisea Set-Cookie header setCookieHeader, String the cookie name to check name, String the cookie domain to check domain, String the cookie path to check path)Check if the Set-Cookie header represented as a string is for the name, domain and path given. |
| public static boolean | Returns: true if name, domain, and path, match all match the HttpCookie, false otherwisethe jetty HttpCookie to check cookie, String the cookie name to check name, String the cookie domain to check domain, String the cookie path to check path)Check if the HttpCookie is for the given name, domain and path. |
| private static boolean | |
| private static void |
| EPOCH_EXPIRES | back to summary |
|---|---|
| private static final String EPOCH_EXPIRES | |
| KNOWN_ATTRIBUTES | back to summary |
|---|---|
| private static final Index<String> KNOWN_ATTRIBUTES | |
| SAME_SITE_DEFAULT_ATTRIBUTE | back to summary |
|---|---|
| public static final String SAME_SITE_DEFAULT_ATTRIBUTE Name of context attribute with default SameSite cookie value | |
| HttpCookieUtils | back to summary |
|---|---|
| private HttpCookieUtils() | |
| checkSameSite | back to summary |
|---|---|
| public static HttpCookie checkSameSite(HttpCookie cookie, Attributes attributes) Check that samesite is set on the cookie. If not, use a context default value, if one has been set.
| |
| getRFC2965SetCookie | back to summary |
|---|---|
| public static String getRFC2965SetCookie(HttpCookie httpCookie) | |
| getRFC6265SetCookie | back to summary |
|---|---|
| public static String getRFC6265SetCookie(HttpCookie httpCookie) | |
| getSameSiteDefault | back to summary |
|---|---|
| public static HttpCookie. Get the default value for SameSite cookie attribute, if one has been set for the given context.
| |
| getSetCookie | back to summary |
|---|---|
| public static String getSetCookie(HttpCookie httpCookie, CookieCompliance compliance) | |
| isQuoteNeeded | back to summary |
|---|---|
| private static boolean isQuoteNeeded(String text) Whether a cookie name/value/attribute needs to be quoted.
| |
| match | back to summary |
|---|---|
| public static boolean match(String setCookieHeader, String name, String domain, String path) Check if the Set-Cookie header represented as a string is for the name, domain and path given. | |
| match | back to summary |
|---|---|
| public static boolean match(HttpCookie cookie, String name, String domain, String path) Check if the HttpCookie is for the given name, domain and path.
| |
| match | back to summary |
|---|---|
| private static boolean match(String oldName, String oldDomain, String oldPath, String newName, String newDomain, String newPath) Check if all old parameters match the new parameters.
| |
| quoteIfNeededAndAppend | back to summary |
|---|---|
| private static void quoteIfNeededAndAppend(String text, StringBuilder builder) | |
HttpField that holds an HttpHeader#SET_COOKIE as a
HttpCookie instance, delaying any value generation until
getValue() is called.
| Modifier and Type | Field and Description |
|---|---|
| private final HttpCookie | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public HttpCookie | |
| public String |
| _cookie | back to summary |
|---|---|
| private final HttpCookie _cookie | |
| _value | back to summary |
|---|---|
| private final String _value | |
| SetCookieHttpField | back to summary |
|---|---|
| public SetCookieHttpField(HttpCookie cookie, CookieCompliance compliance) | |
| getHttpCookie | back to summary |
|---|---|
| public HttpCookie getHttpCookie() | |
| getValue | back to summary |
|---|---|
| public String getValue() Overrides org. Doc from org. Get the field value. | |