module Cookie: sig
.. end
Generate and parse cookies
class cookie : name:string -> value:string -> max_age:int option -> domain:string -> path:string -> secure:bool ->
object
.. end
val cookie : ?max_age:int ->
?domain:string ->
?path:string -> ?secure:bool -> string -> string -> cookie
cookie ?expires ?domain ?path name value
creates a cookie
with name name
and value value
.
max_age
: lifetime of the cookie in seconds (default: none).
domain
: domain of the cookie (default: "").
path
: path of the cookie (default: "").
secure
: whether the cookie is secure (default: false
).
val parse : string -> cookie list
parse header
parse zero or more cookies. Normally header
comes from a "Cookie: header" field.