Cookie

zio.http.Cookie
See theCookie companion object
sealed trait Cookie

Cookie is an immutable and type-safe representation of an HTTP cookie. There are two types of cookies: request cookies and response cookies. These can be created with the constructors in the companion object of Cookie.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Request
class Response
Self type

Members list

Value members

Abstract methods

def content: String
def content(content: String): Cookie

Returns a new cookie derived from this one, but where the content of the cookie is set to the specified value.

Returns a new cookie derived from this one, but where the content of the cookie is set to the specified value.

Attributes

def encodeValidate(validate: Boolean): Either[Exception, String]

Encodes the cookie into a string, or fails with an exception if there was a problem during encoding. This encoding method performs validation as specified.

Encodes the cookie into a string, or fails with an exception if there was a problem during encoding. This encoding method performs validation as specified.

Attributes

def name: String
def name(name: String): Cookie

Returns a new cookie derived from this one, but where the name of the cookie is set to the specified value.

Returns a new cookie derived from this one, but where the name of the cookie is set to the specified value.

Attributes

Concrete methods

final def encode: Either[Exception, String]

Encodes the cookie into a string, or fails with an exception if there was a problem during encoding. This encoding method performs no validation.

Encodes the cookie into a string, or fails with an exception if there was a problem during encoding. This encoding method performs no validation.

Attributes

Converts the cookie to a request cookie. If the cookie is a response cookie, then it is converted into a request cookie by discarding everything except the name and content.

Converts the cookie to a request cookie. If the cookie is a response cookie, then it is converted into a request cookie by discarding everything except the name and content.

Attributes

Converts the cookie to a response cookie, using, if necessary, default values for all the parameters of a response cookie.

Converts the cookie to a response cookie, using, if necessary, default values for all the parameters of a response cookie.

Attributes

def toResponse(domain: Option[String], path: Option[Path], isSecure: Boolean, isHttpOnly: Boolean, maxAge: Option[Duration], sameSite: Option[SameSite]): Response

Converts the cookie to a response cookie, using the specified values only if this cookie is a request cookie.

Converts the cookie to a response cookie, using the specified values only if this cookie is a request cookie.

Attributes