SessionTrackerById

class SessionTrackerById<S : Any>(type: KClass<S>, serializer: SessionSerializer<S>, storage: SessionStorage, sessionIdProvider: () -> String) : SessionTracker<S>

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

Link copied to clipboard
fun <S : Any> SessionTrackerById(type: KClass<S>, serializer: SessionSerializer<S>, storage: SessionStorage, sessionIdProvider: () -> String)

Functions

Link copied to clipboard
open suspend override fun clear(call: ApplicationCall)

Clear session information

Link copied to clipboard
open suspend override fun load(call: ApplicationCall, transport: String?): S?

Load session value from transport string for the specified call

Link copied to clipboard
open suspend override fun store(call: ApplicationCall, value: S): String

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

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun validate(value: S)

Validate session information

Properties

Link copied to clipboard
val serializer: SessionSerializer<S>

session serializer

Link copied to clipboard
val sessionIdProvider: () -> String

is a function that generates session IDs

Link copied to clipboard
val storage: SessionStorage

session storage to store session

Link copied to clipboard
val type: KClass<S>

is a session instance type