Module

Biscotti.Cookie.Parser

This module is responsible for parsing a string into an Either ParseError Cookie.

#parse

parse :: String -> Either ParseError Cookie

Parses a String into an Either ParseError Cookie. This function is primarily intended to parse the Set-Cookie header on the client.

> Parser.parse "key=value; Secure"
(Right { name: "key", value: "value", secure: true, ... })

#parseMany

parseMany :: String -> Either ParseError (List Cookie)

Parses a String into an Either ParseError (List Cookie). HTTP requests can include multiple cookies in a single Cookie header consisting of only name/value pairs. This function can be used to parse this header.

> parseMany "key1=value1; key2=value2"
(Right ({ name: "key1", value: "value1", ... } : { name: "key2", value: "value2", ... } : Nil))

Modules