class HttpCookie
source · line 45public class HttpCookie internal constructor(
/**
* The cookie name/value pair.
*/
public val pair: HttpCookiePair,
/**
* The resolved host or domain scope.
*/
public val host: UrlHost,
/**
* Whether only the exact host matches, rather than its subdomains.
*/
public val hostOnly: Boolean,
/**
* The cookie path bytes.
*/
public val path: Array<Byte>,
/**
* The resolved absolute expiry, or None for a session cookie.
*/
public val expiresAt: Instant?,
/**
* Whether transmission requires a secure scheme.
*/
public val secure: Boolean,
/**
* Whether the cookie is marked inaccessible to non-HTTP scripting APIs.
*/
public val httpOnly: Boolean,
/**
* The interpreted SameSite policy.
*/
public val sameSite: HttpCookieSameSite
)
A resolved cookie with host/path scope, expiry, and flags. URL matching and SameSite decisions are separate operations.
function isExpired
source · line 83public fun isExpired(now: Instant): Boolean
Tests expiry against the supplied current instant; session cookies do not expire by this check.
parameter now
source · line 83now: Instant
property sameSite
source · line 77public val sameSite: HttpCookieSameSite
get: public read-only
The interpreted SameSite policy.
property path
source · line 61public val path: Array<Byte>
get: public read-only
The cookie path bytes.
property secure
source · line 69public val secure: Boolean
get: public read-only
Whether transmission requires a secure scheme.
function matches
source · line 88public fun matches(url: Url, now: Instant): Boolean
Checks expiry, secure scheme, host/domain, and path for the URL; apply SameSite policy separately.
parameter url
source · line 88url: Url
parameter now
source · line 88now: Instant
property host
source · line 53public val host: UrlHost
get: public read-only
The resolved host or domain scope.
property expiresAt
source · line 65public val expiresAt: Instant?
get: public read-only
The resolved absolute expiry, or None for a session cookie.
function allowsSameSite
source · line 100public fun allowsSameSite(isSameSiteRequest: Boolean, isTopLevelNavigation: Boolean, isSafeMethod: Boolean): Boolean
Evaluates SameSite using explicit same-site, top-level-navigation, and safe-method context.
parameter isTopLevelNavigation
source · line 100isTopLevelNavigation: Boolean
parameter isSameSiteRequest
source · line 100isSameSiteRequest: Boolean
parameter isSafeMethod
source · line 100isSafeMethod: Boolean
function allowsSetting
source · line 110public fun allowsSetting(isSameSiteRequest: Boolean, isTopLevelNavigation: Boolean): Boolean
Tests whether this cookie's SameSite policy permits setting it in the supplied request context.
parameter isSameSiteRequest
source · line 110isSameSiteRequest: Boolean
parameter isTopLevelNavigation
source · line 110isTopLevelNavigation: Boolean
property hostOnly
source · line 57public val hostOnly: Boolean
get: public read-only
Whether only the exact host matches, rather than its subdomains.
property pair
source · line 49public val pair: HttpCookiePair
get: public read-only
The cookie name/value pair.
property httpOnly
source · line 73public val httpOnly: Boolean
get: public read-only
Whether the cookie is marked inaccessible to non-HTTP scripting APIs.