Package io.undertow.util
Class Cookies
java.lang.Object
io.undertow.util.Cookies
Class that contains utility methods for dealing with cookies.
- Author:
- Stuart Douglas, Andre Dietisheim, Richard Opalka
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassembleCrumbs(HeaderMap headerMap) Cookie headers form: https://www.rfc-editor.org/rfc/rfc6265#section-4.2.1 If more than one header entry exist for "Cookie", it will be assembled into one that conforms to rfc.static voiddisperseCrumbs(HeaderMap headerMap) IF there is single entry that follows RFC separation rules, it will be turned into singular fields.Fetch list containing crumbs( singular entries of Cookie header )static booleanparseRequestCookies(int maxCookies, boolean allowEqualInValue, List<String> cookies) Deprecated, for removal: This API element is subject to removal in a future version.static voidparseRequestCookies(int maxCookies, boolean allowEqualInValue, List<String> cookies, Set<Cookie> parsedCookies) static CookieparseSetCookieHeader(String headerValue) Parses a "Set-Cookie:" response header value into its cookie representation.
-
Field Details
-
DOMAIN
- See Also:
-
VERSION
- See Also:
-
PATH
- See Also:
-
-
Method Details
-
parseSetCookieHeader
Parses a "Set-Cookie:" response header value into its cookie representation. The header value is parsed according to the syntax that's defined in RFC2109:set-cookie = "Set-Cookie:" cookies cookies = 1#cookie cookie = NAME "=" VALUE *(";" cookie-av) NAME = attr VALUE = value cookie-av = "Comment" "=" value | "Domain" "=" value | "Max-Age" "=" value | "Path" "=" value | "Secure" | "Version" "=" 1*DIGIT- Parameters:
headerValue- The header value- Returns:
- The cookie
- See Also:
-
parseRequestCookies
@Deprecated(since="2.2.0", forRemoval=true) public static Map<String,Cookie> parseRequestCookies(int maxCookies, boolean allowEqualInValue, List<String> cookies) Deprecated, for removal: This API element is subject to removal in a future version.useparseRequestCookies(int, boolean, List, Set)instead/** Parses the cookies from a list of "Cookie:" header values. The cookie header values are parsed according to RFC2109 that defines the following syntax:cookie = "Cookie:" cookie-version 1*((";" | ",") cookie-value) cookie-value = NAME "=" VALUE [";" path] [";" domain] cookie-version = "$Version" "=" value NAME = attr VALUE = value path = "$Path" "=" value domain = "$Domain" "=" value- Parameters:
maxCookies- The maximum number of cookies. Used to prevent hash collision attacksallowEqualInValue- if true equal characters are allowed in cookie valuescookies- The cookie values to parse- Returns:
- A pared cookie map
- See Also:
-
parseRequestCookies
-
assembleCrumbs
Cookie headers form: https://www.rfc-editor.org/rfc/rfc6265#section-4.2.1 If more than one header entry exist for "Cookie", it will be assembled into one that conforms to rfc.- Parameters:
headerMap-
-
disperseCrumbs
IF there is single entry that follows RFC separation rules, it will be turned into singular fields. This should be only used PRIOR to compression.- Parameters:
headerMap-
-
getCrumbs
Fetch list containing crumbs( singular entries of Cookie header )- Parameters:
headerMap-- Returns:
-
isCrumbsAssemplyDisabled
public static boolean isCrumbsAssemplyDisabled()
-
parseRequestCookies(int, boolean, List, Set)instead