Xiana's session management
Xiana's session management
(->pgobject x)
Transforms Clojure data to a PGobject that contains the data as
JSON. PGObject type defaults to jsonb
but can be changed via
metadata key :pgtype
Transforms Clojure data to a PGobject that contains the data as JSON. PGObject type defaults to `jsonb` but can be changed via metadata key `:pgtype`
(->session-id {{headers :headers cookies :cookies query-params :query-params}
:request})
(<-pgobject v)
Transform PGobject containing json
or jsonb
value to Clojure
data.
Transform PGobject containing `json` or `jsonb` value to Clojure data.
(init-backend {session-backend :session-backend
{storage :storage} :xiana/session-backend
:as config})
(protected-interceptor protected-path excluded-resource)
On enter allows a resource to be served when
session-id
exists in the server's session store.
If the session exists in the session store, it's copies it to the (-> state :session-data),
else responds with {:status 401
:body "Invalid or missing session"}On leave, it updates the session storage from (-> state :session-data)
On enter allows a resource to be served when * it is not protected or * the user-provided `session-id` exists in the server's session store. If the session exists in the session store, it's copies it to the (-> state :session-data), else responds with {:status 401 :body "Invalid or missing session"} On leave, it updates the session storage from (-> state :session-data)
(add! _ k v)
(delete! _ k)
(dump _)
(erase! _)
(fetch _ k)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close