Configuration

class Configuration

Sessions configuration builder

Constructors

Link copied to clipboard
fun Configuration()

Functions

Link copied to clipboard
fun register(provider: SessionProvider<*>)

Register a session provider

Properties

Link copied to clipboard
val providers: List<SessionProvider<*>>

List of session providers to be registered

Extensions

Link copied to clipboard
fun <S : Any> Sessions.Configuration.cookie(name: String, sessionType: KClass<S>, storage: SessionStorage)
inline fun <S : Any> Sessions.Configuration.cookie(name: String, storage: SessionStorage)
inline fun <S : Any> Sessions.Configuration.cookie(name: String, sessionType: KClass<S>, storage: SessionStorage, block: CookieIdSessionBuilder<S>.() -> Unit)

Configure sessions to get it from cookie using session storage

inline fun <S : Any> Sessions.Configuration.cookie(name: String, storage: SessionStorage, block: CookieIdSessionBuilder<S>.() -> Unit)

Configures a session using a cookie with the specified name using it as a session id. The actual content of the session is stored at server side using the specified storage. The cookie configuration can be set inside block using the cookie property exposed by CookieIdSessionBuilder.

fun <S : Any> Sessions.Configuration.cookie(name: String, sessionType: KClass<S>)
inline fun <S : Any> Sessions.Configuration.cookie(name: String)

Configure sessions to serialize to/from HTTP cookie

inline fun <S : Any> Sessions.Configuration.cookie(name: String, block: CookieSessionBuilder<S>.() -> Unit)

Configures a session using a cookie with the specified name using it as for the actual session content optionally transformed by specified transforms in block. The cookie configuration can be set inside block using the cookie property exposed by CookieIdSessionBuilder.

inline fun <S : Any> Sessions.Configuration.cookie(name: String, sessionType: KClass<S>, block: CookieSessionBuilder<S>.() -> Unit)

Configure sessions to serialize to/from HTTP cookie configuring it by block

Link copied to clipboard
fun <S : Any> Sessions.Configuration.header(name: String, sessionType: KClass<S>, storage: SessionStorage)
inline fun <S : Any> Sessions.Configuration.header(name: String, storage: SessionStorage)

Configure sessions to get it from HTTP header using session storage

inline fun <S : Any> Sessions.Configuration.header(name: String, storage: SessionStorage, block: HeaderIdSessionBuilder<S>.() -> Unit)
inline fun <S : Any> Sessions.Configuration.header(name: String, sessionType: KClass<S>, storage: SessionStorage, block: HeaderIdSessionBuilder<S>.() -> Unit)

Configures a session using a header with the specified name using it as a session id. The actual content of the session is stored at server side using the specified storage.

fun <S : Any> Sessions.Configuration.header(name: String, sessionType: KClass<S>)
inline fun <S : Any> Sessions.Configuration.header(name: String)

Configure sessions to serialize to/from HTTP header

inline fun <S : Any> Sessions.Configuration.header(name: String, block: HeaderSessionBuilder<S>.() -> Unit)

Configures a session using a header with the specified name using it for the actual session content optionally transformed by specified transforms in block.

inline fun <S : Any> Sessions.Configuration.header(name: String, sessionType: KClass<S>, block: HeaderSessionBuilder<S>.() -> Unit)

Configures a session using a header with the specified name using it for the actual session content and apply block function to configure serializataion and optional transformations