Cookies

A comprehensive and standards compliant HTTP cookies library for ocaml.

HTTP cookies are serialized as follows:

The library supports consuming and creating HTTP cookies in both requests and responses.

The standards implemented by the library is

API Documentation

Installation

$ opam install http-cookie

Usage

Create a cookie,

Http_cookie.create "SID" "23432324"

Serialize cookie to a HTTP Set-Cookie header value,

let s = Http_cookie.to_set_cookie_header_value c in
s = "SID=31d4d96e407aad42; Path=/; Secure; HttpOnly; Expires=Sun, 06 Nov 1994 08:49:37 GMT"