cookie c : {A : string, B : float, C : int}
fun set r =
setCookie c {Value = {A = r.A, B = readError r.B, C = readError r.C},
Expires = None,
Secure = False};
return Cookie set.
fun setExp r =
setCookie c {Value = {A = r.A, B = readError r.B, C = readError r.C},
Expires = Some (readError "2012-11-6 00:00:00"),
Secure = False};
return Cookie set robustly.
fun delete () =
clearCookie c;
return Cookie cleared.
fun main () =
ro <- getCookie c;
return
{case ro of
None => No cookie set.
| Some v =>
Cookie: A = {[v.A]}, B = {[v.B]}, C = {[v.C]}
}