OptionalCookieField

class OptionalCookieField<T>(val inner: CookieField<T>) : CookieField<T?>

A cookie field that is optional.

Constructors

Link copied to clipboard
constructor(inner: CookieField<T>)

Properties

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

The field name(s) for this field.

Link copied to clipboard
Link copied to clipboard
open override 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>)
open infix override fun decode(cookies: Map<String, String>): T?
Link copied to clipboard
open override fun domain(): String?

The domain for which the cookie is valid.

Link copied to clipboard
open override 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 override fun isHttpOnly(): Boolean

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

Link copied to clipboard
open override 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 override fun path(): String?

The path for which the cookie is valid.

Link copied to clipboard
open override fun sameSite(): SameSite

The SameSite attribute of the cookie.

Link copied to clipboard
open override fun secure(): Boolean

Whether the cookie should only be sent over secure connections.