Cookie

data class Cookie(name: String, value: String, encoding: CookieEncoding, maxAge: Int, expires: GMTDate?, domain: String?, path: String?, secure: Boolean, httpOnly: Boolean, extensions: Map<String, String?>)

Represents a cookie with name, content and a set of settings such as expiration, visibility and security. A cookie with neither expires nor maxAge is a session cookie.

Constructors

Link copied to clipboard
fun Cookie(name: String, value: String, encoding: CookieEncoding = CookieEncoding.URI_ENCODING, maxAge: Int = 0, expires: GMTDate? = null, domain: String? = null, path: String? = null, secure: Boolean = false, httpOnly: Boolean = false, extensions: Map<String, String?> = emptyMap())

Functions

Link copied to clipboard
fun getMaxAge(): Int

Properties

Link copied to clipboard
val domain: String? = null

for which it is set

Link copied to clipboard
val encoding: CookieEncoding
Link copied to clipboard
val expires: GMTDate? = null

date when it expires

Link copied to clipboard
val extensions: Map<String, String?>

additional cookie extensions

Link copied to clipboard
val httpOnly: Boolean = false

only transfer cookie over HTTP, no access from JavaScript

Link copied to clipboard
@get:JvmName(name = "getMaxAgeInt")
val maxAge: Int = 0

number of seconds to keep cookie

Link copied to clipboard
val name: String
Link copied to clipboard
val path: String? = null

for which it is set

Link copied to clipboard
val secure: Boolean = false

send it via secure connection only

Link copied to clipboard
val value: String