io.undertow.util

## Class Cookies

- java.lang.Object
- - io.undertow.util.Cookies

    public class Cookies
    extends Object

Class that contains utility methods for dealing with cookies.

Author:
  Stuart Douglas, Andre Dietisheim, Richard Opalka

### Field Summary

Fields
`static String` `DOMAIN`
`static String` `PATH`
`static String` `VERSION`

### Method Summary

All Methods Static Methods Concrete Methods Deprecated Methods
`static Map<String,Cookie>` `parseRequestCookies(int maxCookies, boolean allowEqualInValue, List<String> cookies)` Deprecated. use `parseRequestCookies(int, boolean, List, Set)` instead
`static void` `parseRequestCookies(int maxCookies, boolean allowEqualInValue, List<String> cookies, Set<Cookie> parsedCookies)`
`static Cookie` `parseSetCookieHeader(String headerValue)` Parses a "Set-Cookie:" response header value into its cookie representation.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DOMAIN

    public static final String DOMAIN

See Also:
  Constant Field Values

#### VERSION

    public static final String VERSION

See Also:
  Constant Field Values

#### PATH

    public static final String PATH

See Also:
  Constant Field Values

### Method Detail

#### parseSetCookieHeader

    public static Cookie parseSetCookieHeader(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

Parameters:
  `headerValue` - The header value
Returns:
  The cookie
See Also:
  `Cookie`, rfc2109

#### parseRequestCookies

    @Deprecated
    public static Map<String,Cookie> parseRequestCookies(int maxCookies,
                                                                     boolean allowEqualInValue,
                                                                     List<String> cookies)

Deprecated. use `parseRequestCookies(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 attacks
  `allowEqualInValue` - if true equal characters are allowed in cookie values
  `cookies` - The cookie values to parse
Returns:
  A pared cookie map
See Also:
  `Cookie`, rfc2109

#### parseRequestCookies

    public static void parseRequestCookies(int maxCookies,
                                           boolean allowEqualInValue,
                                           List<String> cookies,
                                           Set<Cookie> parsedCookies)