SessionTrackerById

class SessionTrackerById : SessionTracker

SessionTracker that transfers a Session Id generated by a sessionIdProvider in HTTP Headers/Cookies. It uses a storage and a serializer to store/load serialized/deserialized session content of a specific type.

Constructors

<init>

SessionTrackerById(
    type: KClass<*>,
    serializer: SessionSerializer,
    storage: SessionStorage,
    sessionIdProvider: () -> String)

SessionTracker that transfers a Session Id generated by a sessionIdProvider in HTTP Headers/Cookies. It uses a storage and a serializer to store/load serialized/deserialized session content of a specific type.

Properties

serializer

val serializer: SessionSerializer

session serializer

sessionIdProvider

val sessionIdProvider: () -> String

is a function that generates session IDs

storage

val storage: SessionStorage

session storage to store session

type

val type: KClass<*>

is a session instance type

Functions

clear

suspend fun clear(call: ApplicationCall): Unit

Clear session information

load

suspend fun load(
    call: ApplicationCall,
    transport: String?
): Any?

Load session value from transport string for the specified call

store

suspend fun store(call: ApplicationCall, value: Any): String

Store session value and return respective transport string for the specified call.

toString

fun toString(): String

validate

fun validate(value: Any): Unit

Validate session information