Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Cookies
A comprehensive and strict standards compliant HTTP cookies library for ocaml. API Documentation
http-cookie supports consuming and creating HTTP cookies found in HTTP request Cookie header and in Set-Cookie header in HTTP response. The library validates all cookie attributes, cookie name and cookie value for standards conformance and correct usage. The validation suite is comprehensive and includes validation of domain name, IPv4, IPv6 and HTTP date-time formats.
# let s = "SID=234234asdasdasda" in
let c = List.nth (Http_cookie.of_cookie s |> Result.get_ok) 0 in
let s1 = Http_cookie.to_cookie c in
s = s1 ;;
- : bool = true
HTTP Set-Cookie header value:
# let s = "SID=31d4d96e407aad42; Path=/; Domain=ffff::0234:ddd:192.168.0.1; Expires=Sun, 06 Nov 1994 08:49:37 GMT; Secure; HttpOnly" in
let c = Http_cookie.of_set_cookie s |> Result.get_ok in
let s2 = Http_cookie.to_set_cookie c in
s = s2
- : bool = true