SessionContext

Typed authentication context used by Session authentication.

The context exposes the session value that passed authentication and helpers to update or clear that session in a type-safe way.

Report a problem

Type Parameters

S

the stored session type.

Functions

Link copied to clipboard

Clears the authenticated session for call.

Link copied to clipboard

Returns the session value that passed authentication for call.

Link copied to clipboard

Returns the session value that passed authentication for call, or null when no session is stored.

Link copied to clipboard
fun setSession(call: ApplicationCall, value: S)

Sets a new session value for call.

Link copied to clipboard
fun updateSession(call: ApplicationCall, transform: (S) -> S): S

Replaces the authenticated session with the value returned by transform.