SessionsConfig

class SessionsConfig

A configuration for the Sessions plugin.

Constructors

Link copied to clipboard
fun SessionsConfig()

Functions

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

Registers a session provider.

Properties

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

Gets a list of session providers to be registered.

Extensions

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

Configures Sessions to pass a session identifier in cookies using the nameSet-Cookie attribute and store the serialized session's data in the server storage.

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

Configures Sessions to pass a session identifier in cookies using the nameSet-Cookie attribute and store the serialized session's data in the server storage. The block parameter allows you to configure additional cookie settings, for example:

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

Configures Sessions to pass the serialized session's data in cookies using the nameSet-Cookie attribute.

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

Configures Sessions to pass the serialized session's data in cookies using the nameSet-Cookie attribute. The block parameter allows you to configure additional cookie settings, for example:

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

Configures Sessions to pass a session identifier in a name HTTP header and store the serialized session's data in the server storage.

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

Configures Sessions to pass a session identifier in a name HTTP header and store the serialized session's data in the server storage. The block parameter allows you to configure additional settings, for example, sign and encrypt session data.

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

Configures Sessions to pass the serialized session's data in a name HTTP header.

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

Configures Sessions to pass the serialized session's data in a name HTTP header. The block parameter allows you to configure additional settings, for example, sign and encrypt session data.