Package io.undertow.util
Class Cookies
- java.lang.Object
-
- io.undertow.util.Cookies
-
public class Cookies extends java.lang.ObjectClass that contains utility methods for dealing with cookies.- Author:
- Stuart Douglas, Andre Dietisheim, Richard Opalka
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static 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.static java.util.List<java.lang.String>getCrumbs(HeaderMap headerMap)Fetch list containing crumbs( singular entries of Cookie header )static booleanisCrumbsAssemplyDisabled()static java.util.Map<java.lang.String,Cookie>parseRequestCookies(int maxCookies, boolean allowEqualInValue, java.util.List<java.lang.String> cookies)Deprecated, for removal: This API element is subject to removal in a future version.useparseRequestCookies(int, boolean, List, Set)insteadstatic voidparseRequestCookies(int maxCookies, boolean allowEqualInValue, java.util.List<java.lang.String> cookies, java.util.Set<Cookie> parsedCookies)static CookieparseSetCookieHeader(java.lang.String headerValue)Parses a "Set-Cookie:" response header value into its cookie representation.
-
-
-
Field Detail
-
DOMAIN
public static final java.lang.String DOMAIN
- See Also:
- Constant Field Values
-
VERSION
public static final java.lang.String VERSION
- See Also:
- Constant Field Values
-
PATH
public static final java.lang.String PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseSetCookieHeader
public static Cookie parseSetCookieHeader(java.lang.String headerValue)
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
-
parseRequestCookies
@Deprecated(since="2.2.0", forRemoval=true) public static java.util.Map<java.lang.String,Cookie> parseRequestCookies(int maxCookies, boolean allowEqualInValue, java.util.List<java.lang.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
-
parseRequestCookies
public static void parseRequestCookies(int maxCookies, boolean allowEqualInValue, java.util.List<java.lang.String> cookies, java.util.Set<Cookie> parsedCookies)
-
assembleCrumbs
public static void assembleCrumbs(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.- Parameters:
headerMap-
-
disperseCrumbs
public static void disperseCrumbs(HeaderMap headerMap)
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
public static java.util.List<java.lang.String> getCrumbs(HeaderMap headerMap)
Fetch list containing crumbs( singular entries of Cookie header )- Parameters:
headerMap-- Returns:
-
isCrumbsAssemplyDisabled
public static boolean isCrumbsAssemplyDisabled()
-
-