Cookie

is a simple cookie data type. You usually shouldn’t need to build the type yourself, instead you can parse it.

domain

instantiate

(λ [(Ref Cookie a)] (Ref (Maybe String) a))

gets the domain property of a Cookie.

expired?

defn

(λ [(Ref Cookie a)] Bool)

                    (expired? c)
                

checks if a cookie is expired now.

expires

instantiate

(λ [(Ref Cookie a)] (Ref (Maybe Datetime) a))

gets the expires property of a Cookie.

http-only

instantiate

(λ [(Ref Cookie a)] (Ref Bool a))

gets the http-only property of a Cookie.

init

instantiate

(λ [String, String, String, (Maybe Datetime), (Maybe String), Bool, Bool, SameSite] Cookie)

creates a Cookie.

kv

defn

(λ [(Ref Cookie a)] String)

                    (kv c)
                

makes a name=value pair from a cookie.

name

instantiate

(λ [(Ref Cookie a)] (Ref String a))

gets the name property of a Cookie.

parse

defn

(λ [(Ref String a)] (Result Cookie String))

                    (parse s)
                

parses a cookie.

parse-many

defn

(λ [(Ref String a)] (Result (Array Cookie) String))

                    (parse-many s)
                

parses multiple cookies.

parse-set

defn

(λ [(Ref String a)] (Result Cookie String))

                    (parse-set s)
                

parses a Set-Cookie form.

path

instantiate

(λ [(Ref Cookie a)] (Ref String a))

gets the path property of a Cookie.

same-site

instantiate

(λ [(Ref Cookie a)] (Ref SameSite a))

gets the same-site property of a Cookie.

secure

instantiate

(λ [(Ref Cookie a)] (Ref Bool a))

gets the secure property of a Cookie.

set

defn

(λ [(Ref Cookie a)] String)

                    (set c)
                

makes a proper set cookie string from a cookie.

set-domain

instantiate

(λ [Cookie, (Maybe String)] Cookie)

sets the domain property of a Cookie.

set-domain!

instantiate

(λ [(Ref Cookie a), (Maybe String)] ())

sets the domain property of a Cookie in place.

set-expires

instantiate

(λ [Cookie, (Maybe Datetime)] Cookie)

sets the expires property of a Cookie.

set-expires!

instantiate

(λ [(Ref Cookie a), (Maybe Datetime)] ())

sets the expires property of a Cookie in place.

set-http-only

instantiate

(λ [Cookie, Bool] Cookie)

sets the http-only property of a Cookie.

set-http-only!

instantiate

(λ [(Ref Cookie a), Bool] ())

sets the http-only property of a Cookie in place.

set-name

instantiate

(λ [Cookie, String] Cookie)

sets the name property of a Cookie.

set-name!

instantiate

(λ [(Ref Cookie a), String] ())

sets the name property of a Cookie in place.

set-path

instantiate

(λ [Cookie, String] Cookie)

sets the path property of a Cookie.

set-path!

instantiate

(λ [(Ref Cookie a), String] ())

sets the path property of a Cookie in place.

set-same-site

instantiate

(λ [Cookie, SameSite] Cookie)

sets the same-site property of a Cookie.

set-same-site!

instantiate

(λ [(Ref Cookie a), SameSite] ())

sets the same-site property of a Cookie in place.

set-secure

instantiate

(λ [Cookie, Bool] Cookie)

sets the secure property of a Cookie.

set-secure!

instantiate

(λ [(Ref Cookie a), Bool] ())

sets the secure property of a Cookie in place.

set-value

instantiate

(λ [Cookie, String] Cookie)

sets the value property of a Cookie.

set-value!

instantiate

(λ [(Ref Cookie a), String] ())

sets the value property of a Cookie in place.

str

instantiate

(λ [(Ref Cookie a)] String)

converts a Cookie to a string.

update-domain

instantiate

(λ [Cookie, (Ref (λ [(Maybe String)] (Maybe String) a) b)] Cookie)

updates the domain property of a Cookie using a function f.

update-expires

instantiate

(λ [Cookie, (Ref (λ [(Maybe Datetime)] (Maybe Datetime) a) b)] Cookie)

updates the expires property of a Cookie using a function f.

update-http-only

instantiate

(λ [Cookie, (Ref (λ [Bool] Bool a) b)] Cookie)

updates the http-only property of a Cookie using a function f.

update-name

instantiate

(λ [Cookie, (Ref (λ [String] String a) b)] Cookie)

updates the name property of a Cookie using a function f.

update-path

instantiate

(λ [Cookie, (Ref (λ [String] String a) b)] Cookie)

updates the path property of a Cookie using a function f.

update-same-site

instantiate

(λ [Cookie, (Ref (λ [SameSite] SameSite a) b)] Cookie)

updates the same-site property of a Cookie using a function f.

update-secure

instantiate

(λ [Cookie, (Ref (λ [Bool] Bool a) b)] Cookie)

updates the secure property of a Cookie using a function f.

update-value

instantiate

(λ [Cookie, (Ref (λ [String] String a) b)] Cookie)

updates the value property of a Cookie using a function f.

value

instantiate

(λ [(Ref Cookie a)] (Ref String a))

gets the value property of a Cookie.