No matching definitions.

session/ctx

src/session/ctx.tur

per-request session state and the user-facing helpers.

Since: v0.1.0

defn

sess-id

(sess-id [p : int] :)

session ID string held by a session-state struct (borrowed).

defn

sess-map

(sess-map [p : int] :)

SessMap handle held by a session-state struct.

defn

sess-dirty?

(sess-dirty? [p : int] :)

1 if the session was written since load.

defn

sess-destroy?

(sess-destroy? [p : int] :)

1 if session-destroy! was called.

defn

sess-new?

(sess-new? [p : int] :)

1 if a fresh session ID was minted (no valid cookie present).

defn

sess-rotate-from

(sess-rotate-from [p : int] :)

the original (pre-rotate) session ID, or NULL.

defn

sess-free

(sess-free [p : int] :)

free the session-state struct, its id, and its map.

defn

session-existing

(session-existing [ctx : Ctx] :)

the session-state struct already attached, or 0.

Since: v0.1.0

defn

session-get

(session-get [ctx : Ctx key : cstr] :)

read a session value.

ctxtourist context
keysession key

(Result cstr cstr)

Since: v0.1.0

defn

session-set!

(session-set! [ctx : Ctx key : cstr val : cstr] :)

write a session value (marks the session dirty).

Since: v0.1.0

defn

session-del!

(session-del! [ctx : Ctx key : cstr] :)

remove a session key (marks the session dirty).

Since: v0.1.0

defn

session-destroy!

(session-destroy! [ctx : Ctx] :)

delete the session from the store and clear its cookie.

Since: v0.1.0

defn

session-id

(session-id [ctx : Ctx] :)

the current session ID (borrowed; 64-char hex).

Since: v0.1.0

defn

session-rotate!

(session-rotate! [ctx : Ctx] :)

issue a fresh session ID, carrying the data forward.

ctxtourist context

Since: v0.2.0

Internal definitions
__sess-new
__sess-set-dirty!
__sess-set-destroy!
__sess-set-rotate-from!-- stash the original ID, once.
__sess-set-id!-- replace the session ID, releasing the old owned String.
__ctx-attr-int-- read a per-request attr as an int (0 if absent).
__cstr-null?
__cstr-dup
__session-ensure-- lazily load/create the session for this request.
__session-init
__session-init-with-id-- load a verified session ID from the store.
__session-attach