package http-cookie

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Cookies

A comprehensive and standards compliant HTTP cookies library for ocaml.

HTTP cookies are serialized as follows:

  • In a Cookie header in a HTTP request
  • In a Set-Cookie header in a HTTP response.

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"
OCaml

Innovation. Community. Security.