api

http4k / org.http4k.core.cookie / Cookie

Cookie

data class Cookie

Constructors

Name Summary
<init> Cookie(name: String, value: String, maxAge: Long? = null, expires: LocalDateTime? = null, domain: String? = null, path: String? = null, secure: Boolean = false, httpOnly: Boolean = false, sameSite: SameSite? = null)

Properties

Name Summary
domain val domain: String?
expires val expires: LocalDateTime?
httpOnly val httpOnly: Boolean
maxAge val maxAge: Long?
name val name: String
path val path: String?
sameSite val sameSite: SameSite?
secure val secure: Boolean
value val value: String

Functions

Name Summary
domain fun domain(domain: String): Cookie
expires fun expires(date: LocalDateTime): Cookie
fullCookieString fun fullCookieString(): String
httpOnly fun httpOnly(): Cookie
keyValueCookieString fun keyValueCookieString(): String
maxAge fun maxAge(seconds: Long): Cookie
path fun path(path: String): Cookie
sameSite fun sameSite(sameSite: SameSite): Cookie
secure fun secure(): Cookie
toString fun toString(): String

Companion Object Functions

Name Summary
parse fun parse(cookieValue: String): Cookie?

Extension Functions

Name Summary
invalidate fun Cookie.invalidate(): Cookie
shouldBeHttpOnly fun Cookie.shouldBeHttpOnly(): Unit
shouldBeSecure fun Cookie.shouldBeSecure(): Unit
shouldHaveDomain infix fun Cookie.shouldHaveDomain(expected: String): Unit
shouldHaveExpiry infix fun Cookie.shouldHaveExpiry(expected: LocalDateTime): Unit
shouldHaveName infix fun Cookie.shouldHaveName(expected: String): Unit
shouldHavePath infix fun Cookie.shouldHavePath(expected: String): Unit
shouldHaveSameSite infix fun Cookie.shouldHaveSameSite(expected: SameSite): Unit
shouldHaveValue infix fun Cookie.shouldHaveValue(expected: String): Unit
shouldNeverExpire fun Cookie.shouldNeverExpire(): Unit
shouldNotBeHttpOnly fun Cookie.shouldNotBeHttpOnly(): Unit
shouldNotBeSecure fun Cookie.shouldNotBeSecure(): Unit
shouldNotHaveDomain infix fun Cookie.shouldNotHaveDomain(expected: String): Unit
shouldNotHaveExpiry infix fun Cookie.shouldNotHaveExpiry(expected: LocalDateTime): Unit
shouldNotHaveName infix fun Cookie.shouldNotHaveName(expected: String): Unit
shouldNotHavePath infix fun Cookie.shouldNotHavePath(expected: String): Unit
shouldNotHaveSameSite infix fun Cookie.shouldNotHaveSameSite(expected: SameSite): Unit
shouldNotHaveValue infix fun Cookie.shouldNotHaveValue(expected: String): Unit