Stateful access to cookie values
Stateful access to cookie values
(get k)
(get k default)
Get the value of a cookie from the request. k can either be a string or keyword. If this is a signed cookie, use get-signed, otherwise the signature will not be checked.
Get the value of a cookie from the request. k can either be a string or keyword. If this is a signed cookie, use get-signed, otherwise the signature will not be checked.
(get-signed sign-key k)
(get-signed sign-key k default)
Get the value of a cookie from the request using 'get'. Verifies that a signing cookie also exists. If not, returns default or nil.
Get the value of a cookie from the request using 'get'. Verifies that a signing cookie also exists. If not, returns default or nil.
(put! k v)
Add a new cookie whose name is k and has the value v. If v is a string a cookie map is created with :path '/'. To set custom attributes, such as "expires", provide a map as v. Stores all keys as strings.
Add a new cookie whose name is k and has the value v. If v is a string a cookie map is created with :path '/'. To set custom attributes, such as "expires", provide a map as v. Stores all keys as strings.
(put-signed! sign-key k v)
Adds a new cookie whose name is k and has the value v. In addition, adds another cookie that checks the authenticity of 'v'. Sign-key should be a secret that's user-wide, session-wide or site wide (worst).
Adds a new cookie whose name is k and has the value v. In addition, adds another cookie that checks the authenticity of 'v'. Sign-key should be a secret that's user-wide, session-wide or site wide (worst).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close