Module Http.Cookie


type atts

The type for cookie attributes.

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

atts are the given cookie attributes. If an attribute is absent it is not mentioned in the cookie sepcification except for same_site which are always specified and respectively defaults to "strict" and http_only with default to true.

TODO. Should we default path to "/" and use path ? Also maybe secure should default to true it's just if we devise a good dev/production configuration story.

val atts_default : atts

atts_default is atts ().

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

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

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

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