class HttpSetCookie
source · line 13public class HttpSetCookie private constructor(
/**
* The cookie name/value pair.
*/
public val pair: HttpCookiePair,
/**
* Ordered original cookie attributes.
*/
public val attributes: Array<HttpCookieAttribute>,
/**
* The original parsed field-value bytes, or None for a programmatically constructed value.
*/
public val originalValue: Array<Byte>?
)
One Set-Cookie field with its ordered attributes and interpreted cookie properties. Resolve against the response URL before storing it.
property originalValue
source · line 25public val originalValue: Array<Byte>?
get: public read-only
The original parsed field-value bytes, or None for a programmatically constructed value.
property domain
source · line 42public val domain: Array<Byte>?
get: public read-only
The interpreted Domain attribute bytes, before resolution against an origin.
getter get
source · line 42get(): Option<Array<Int8>>
property expires
source · line 34public val expires: Instant?
get: public read-only
The interpreted Expires date, when valid and present.
getter get
source · line 34get(): Option<Instant>
constructor constructor
source · line 27constructor(pair: HttpCookiePair, attributes: List<HttpCookieAttribute> = emptyList<HttpCookieAttribute>())
parameter pair
source · line 27pair: HttpCookiePair
parameter attributes
source · line 27attributes: List<HttpCookieAttribute> = emptyList<HttpCookieAttribute>()
function expiryFrom
source · line 63public fun expiryFrom(now: Instant, maxLifetimeSeconds: Long = 34560000L): Instant?
Calculates expiry, giving Max-Age precedence and applying the explicit maximum lifetime.
parameter now
source · line 63now: Instant
parameter maxLifetimeSeconds
source · line 63maxLifetimeSeconds: Long = 34560000L
property pair
source · line 17public val pair: HttpCookiePair
get: public read-only
The cookie name/value pair.
property sameSite
source · line 58public val sameSite: HttpCookieSameSite
get: public read-only
The interpreted SameSite policy.
getter get
source · line 58get(): HttpCookieSameSite
property path
source · line 46public val path: Array<Byte>?
get: public read-only
The cookie path bytes.
getter get
source · line 46get(): Option<Array<Int8>>
property httpOnly
source · line 54public val httpOnly: Boolean
get: public read-only
Whether the cookie is marked inaccessible to non-HTTP scripting APIs.
getter get
source · line 54get(): Boolean
function resolve
source · line 69public fun resolve(url: Url, now: Instant, suffixes: PublicSuffixList, maxLifetimeSeconds: Long = 34560000L): Result<HttpCookie, HttpCookieRejection>
Resolves and validates domain, public suffix, path, Secure, SameSite, and name-prefix rules for the response URL.
parameter now
source · line 69now: Instant
parameter suffixes
source · line 69suffixes: PublicSuffixList
parameter maxLifetimeSeconds
source · line 69maxLifetimeSeconds: Long = 34560000L
parameter url
source · line 69url: Url
function toByteArray
source · line 75public fun toByteArray(): Array<Byte>
Serializes the structured value into HTTP field-value bytes.
property attributes
source · line 21public val attributes: Array<HttpCookieAttribute>
get: public read-only
Ordered original cookie attributes.
property secure
source · line 50public val secure: Boolean
get: public read-only
Whether transmission requires a secure scheme.
getter get
source · line 50get(): Boolean
property maxAgeSeconds
source · line 38public val maxAgeSeconds: Long?
get: public read-only
The interpreted Max-Age in seconds, when present.
getter get
source · line 38get(): Option<Long>
function toHttpField
source · line 85public fun toHttpField(): HttpField
Builds a separate Set-Cookie field with never-index enabled.