Liking cljdoc? Tell your friends :D

dev.zeko.stube.session

Session cookies + conversation ownership checks.

Each browser gets a stube_sid cookie minted on first visit; that value is recorded on the conversation as :conv/owner-token when the cid is created. Subsequent requests for that cid are accepted only when the cookie matches the stored token. This is the single primitive authorized? both http and halos handlers use.

Session cookies + conversation ownership checks.

Each browser gets a `stube_sid` cookie minted on first visit; that
value is recorded on the conversation as `:conv/owner-token` when the
cid is created.  Subsequent requests for that cid are accepted only
when the cookie matches the stored token.  This is the single
primitive [[authorized?]] both http and halos handlers use.
raw docstring

authorized?clj

(authorized? req cid)

True when the request's session cookie matches the cid's recorded owner-token, or when the conversation has no owner-token (legacy).

True when the request's session cookie matches the cid's recorded
owner-token, or when the conversation has no owner-token (legacy).
sourceraw docstring

(cookie-map {:keys [headers]})

Parse the Cookie header into a {name → value} map.

Parse the Cookie header into a `{name → value}` map.
sourceraw docstring

ensure-sessionclj

(ensure-session req)

Return [sid set-cookie-header-or-nil]. The Set-Cookie value is only non-nil on the first request from a fresh browser.

Return `[sid set-cookie-header-or-nil]`.  The `Set-Cookie` value is
only non-nil on the first request from a fresh browser.
sourceraw docstring

forbidden-responseclj

(forbidden-response)

403 body sent when authorized? returns false.

403 body sent when [[authorized?]] returns false.
sourceraw docstring

request-sessionclj

(request-session req)

Return the stube_sid cookie value on the request, or nil.

Return the `stube_sid` cookie value on the request, or nil.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close