HttpCookieParser

class HttpCookieParser : QueryParamSet {}

Constructors

this
this(istring[] cookie_names)
Undocumented in source.

Inherited Members

From QueryParamSet

element_delim
char element_delim;
keyval_delim
char keyval_delim;

Delimiter of elements, where each element is a key/value pair, and between key and value of an element.

parse
void parse(cstring query)

Parses query and memorizes the values corresponding to the keys provided to the constructor. query will be sliced.

Examples

static immutable istring cookie_header_value = "test=2649113645; test-value=1383922851";

static immutable istring[] cookie_names =
[
    "test",
    "test-value"
];

scope cookie = new HttpCookieParser(cookie_names);

cookie.parse(cookie_header_value);

test (cookie["test"] == "2649113645");
test (cookie["test-value"] == "1383922851");

Meta