ktor-server-core / io.ktor.sessions / SessionTrackerByValue

SessionTrackerByValue

class SessionTrackerByValue<S : Any> : SessionTracker<S>

SessionTracker that stores the contents of the session as part of HTTP Cookies/Headers. It uses a specific serializer to serialize and deserialize objects of type type.

Constructors

<init>

SessionTrackerByValue(type: KClass<S>, serializer: SessionSerializer<S>)

SessionTracker that stores the contents of the session as part of HTTP Cookies/Headers. It uses a specific serializer to serialize and deserialize objects of type type.

Properties

serializer

val serializer: SessionSerializer<S>

session serializer

type

val type: KClass<S>

is a session instance type

Functions

clear

suspend fun clear(call: ApplicationCall): Unit

Clear session information

load

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

Load session value from transport string for the specified call

store

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

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

toString

fun toString(): String

validate

fun validate(value: S): Unit

Validate session information