CookieField

interface CookieField<T> : KovenField<T>

Interface for cookie fields, allowing type-safe retrieval and definition.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val fields: List<String>

The field name(s) for this field.

Link copied to clipboard
abstract val name: String

Functions

Link copied to clipboard
infix fun <A, B> CookieField<A>.and(other: CookieField<B>): CookiePairField<A, B>

Creates a pair of cookie fields as CookiePairField.

Link copied to clipboard
open fun clear(): Cookie

Creates an empty Cookie with the properties defined in this field for the purpose of clearing an already-existent cookie.

Link copied to clipboard
open infix fun create(value: String): Cookie

Creates a Cookie using the properties defined in this field.

Link copied to clipboard
open fun createCookies(value: T): Cookies

Creates a Cookies object from the given value.

Link copied to clipboard
context(_: Raise<Issue>)
abstract infix fun decode(cookies: Map<String, String>): T
Link copied to clipboard
open fun domain(): String?

The domain for which the cookie is valid.

Link copied to clipboard
abstract fun encodeCookies(value: T): List<Cookie>
Link copied to clipboard
open override fun flatten(): List<CookieField<*>>

Flattens the field into its constituent fields.

Link copied to clipboard
open fun isHttpOnly(): Boolean

Whether this cookie is intended to be server-side only.

Link copied to clipboard
open fun maxAge(): Long?

The maximum age of the cookie in seconds.

Link copied to clipboard

Marks a cookie field as optional.

Link copied to clipboard
open fun path(): String?

The path for which the cookie is valid.

Link copied to clipboard
open fun sameSite(): SameSite

The SameSite attribute of the cookie.

Link copied to clipboard
open fun secure(): Boolean

Whether the cookie should only be sent over secure connections.