Module Http.Cookie



type atts

The type for cookie attributes.

val atts_default : atts

atts_default are cookie attributes with secure set to true, http_only set to true, same_site set to "strict" and no other attribute specified.

val atts : ?init:atts -> ?domain:string option -> ?http_only:bool -> ?max_age:int option -> ?path:path -> ?same_site:string -> ?secure:bool -> unit -> atts

atts () are the given cookie attributes. Those unspecified take the value of init which defaults to atts_default.

val encode : ?atts:atts -> name:string -> string -> string

encodes ~atts name s encodes a cookie with attributes atts (defaults to atts_default) for Headers.add_set_cookie.

val decode_list : string -> ((string * string) list, string) Stdlib.result

decode_list s parses the cookie string of a cookie header value.