Cookie utilities. Uses transit to serialize and deserialize values.
Cookie utilities. Uses transit to serialize and deserialize values.
(get key)
(get key default)
Given a key, gets the deserialized cookie value at the key. Accepts an optional default when value is not found.
Given a key, gets the deserialized cookie value at the key. Accepts an optional default when value is not found.
(remove! key)
Given a key, removes the cookie key.
Given a key, removes the cookie key.
(set! key val)
(set! key val {:keys [max-age path domain secure?] :as opts})
Given a key and a value, sets a cookie key to the serialized value. Accepts an optional map of options with the following keys: :max-age - defaults to -1 (in seconds) :path - path of the cookie, defaults to the full request path :domain - domain of the cookie, when null the browser will use the full request host name :secure? - boolean specifying whether the cookie should only be sent over a secure channel
Given a key and a value, sets a cookie key to the serialized value. Accepts an optional map of options with the following keys: :max-age - defaults to -1 (in seconds) :path - path of the cookie, defaults to the full request path :domain - domain of the cookie, when null the browser will use the full request host name :secure? - boolean specifying whether the cookie should only be sent over a secure channel
(set-secure! key val)
(set-secure! key val opts)
Given a key and a value, sets a secure cookie. Accepts an optional map of options with the following keys: :max-age - defaults to -1 (in seconds) :path - path of the cookie, defaults to the full request path :domain - domain of the cookie, when null the browser will use the full request host name
Given a key and a value, sets a secure cookie. Accepts an optional map of options with the following keys: :max-age - defaults to -1 (in seconds) :path - path of the cookie, defaults to the full request path :domain - domain of the cookie, when null the browser will use the full request host name
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close