Packages

final case class Cookie[T](name: String, content: String, target: Type[T]) extends Product with Serializable

Cookie is an immutable and type-safe representation of an HTTP cookie. It can be of type types viz. Cookie[Request] and Cookie[Response]. Cookie[Request] is only available in the Request object and Cookie[Response] is only available in the Response object.

Self Type
Cookie[T]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Cookie
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Cookie(name: String, content: String, target: Type[T])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. val content: String
  7. def domain(implicit ev: =:=[T, Response]): Option[String]

    Gets the cookie's Domain attribute.

  8. def encode(implicit ev: CookieEncoder[T]): Either[Exception, String]

    Gets the cookie's Expires attribute.

  9. def encode(validate: Boolean)(implicit ev: CookieEncoder[T]): Either[Exception, String]

    Encodes the cookie to a string.

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def isHttpOnly(implicit ev: =:=[T, Response]): Boolean

    Returns true if the cookie is allowed over https only

  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def isSecure(implicit ev: =:=[T, Response]): Boolean

    Returns true if the cookie is allowed over secure connections

  15. def maxAge(implicit ev: =:=[T, Response]): Option[zio.Duration]
  16. val name: String
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def path(implicit ev: =:=[T, Response]): Option[Path]

    Returns the path of the cookie

  21. def productElementNames: Iterator[String]
    Definition Classes
    Product
  22. def sameSite(implicit ev: =:=[T, Response]): Option[SameSite]

    Returns the same-site setting for this cookie.

  23. def sign(secret: String)(implicit ev: =:=[T, Response]): Cookie[T]

    Signs cookie content with a secret and returns a signed cookie.

  24. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  25. val target: Type[T]
  26. def toRequest: Cookie[Request]

    Converts cookie to a request cookie.

  27. def toResponse(domain: Option[String] = None, path: Option[Path] = None, isSecure: Boolean = false, isHttpOnly: Boolean = false, maxAge: Option[Long] = None, sameSite: Option[SameSite] = None): Cookie[Response]

    Converts cookie to a response cookie.

  28. def toResponse: Cookie[Response]

    Converts cookie to a response cookie.

  29. def unSign(secret: String)(implicit ev: =:=[T, Request]): Option[Cookie[T]]

    Un-signs cookie content with a secret and returns an unsigned cookie.

  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. def withContent(content: String): Cookie[T]

    Sets content in cookie

  34. def withDomain(domain: String)(implicit ev: =:=[T, Response]): Cookie[Response]

    Sets domain in cookie

  35. def withHttpOnly(implicit ev: =:=[T, Response]): Cookie[Response]

    Sets httpOnly in cookie

  36. def withHttpOnly(httpOnly: Boolean)(implicit ev: =:=[T, Response]): Cookie[Response]

    Sets httpOnly in cookie

  37. def withMaxAge(seconds: Long)(implicit ev: =:=[T, Response]): Cookie[Response]

    Sets maxAge of the cookie

  38. def withMaxAge(maxAge: zio.Duration)(implicit ev: =:=[T, Response]): Cookie[Response]

    Sets maxAge of the cookie

  39. def withName(name: String): Cookie[T]

    Sets name of the cookie

  40. def withPath(path: Path)(implicit ev: =:=[T, Response]): Cookie[Response]

    Sets path of the cookie

  41. def withSameSite(sameSite: SameSite)(implicit ev: =:=[T, Response]): Cookie[Response]

    Sets sameSite of the cookie

  42. def withSecure(implicit ev: =:=[T, Response]): Cookie[Response]

    Sets secure flag of the cookie

  43. def withSecure(secure: Boolean)(implicit ev: =:=[T, Response]): Cookie[Response]

    Sets secure flag of the cookie

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped