Class

io.scalajs.npm.cookie

SerializationOptions

Related Doc: package cookie

Permalink

class SerializationOptions extends Object

Cookie Serialization Options

Annotations
@ScalaJSDefined() @RawJSType()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SerializationOptions
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SerializationOptions(domain: UndefOr[String] = js.undefined, encode: UndefOr[Function] = js.undefined, expires: UndefOr[String] = js.undefined, httpOnly: UndefOr[Boolean] = js.undefined, maxAge: UndefOr[JsNumber] = js.undefined, path: UndefOr[String] = js.undefined, sameSite: UndefOr[|[Boolean, String]] = js.undefined, secure: UndefOr[Boolean] = js.undefined)

    Permalink

    domain

    Specifies the value for the Domain Set-Cookie attribute. By default, no domain is set, and most clients will consider the cookie to apply to only the current domain.

    encode

    Specifies a function that will be used to encode a cookie's value. Since value of a cookie has a limited character set (and must be a simple string), this function can be used to encode a value into a string suited for a cookie's value. The default function is the global ecodeURIComponent, which will encode a JavaScript string into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range.

    expires

    Specifies the Date object to be the value for the Expires Set-Cookie attribute. By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and will delete it on a condition like exiting a web browser application. Note: the cookie storage model specification states that if both expires and magAge are set, then maxAge takes precedence, but it is possible not all clients by obey this, so if both are set, they should point to the same date and time.

    httpOnly

    Specifies the boolean value for the [HttpOnly Set-Cookie attribute][rfc-6266-5.2.6]. When truthy, the HttpOnly attribute is set, otherwise it is not. By default, the HttpOnly attribute is not set. Note: be careful when setting this to true, as compliant clients will not allow client-side JavaScript to see the cookie in document.cookie.

    maxAge

    Specifies the number (in seconds) to be the value for the Max-Age Set-Cookie attribute. The given number will be converted to an integer by rounding down. By default, no maximum age is set. Note: the cookie storage model specification states that if both expires and magAge are set, then maxAge takes precedence, but it is possiblke not all clients by obey this, so if both are set, they should point to the same date and time.

    path

    Specifies the value for the Path Set-Cookie attribute. By default, the path is considered the "default path". By default, no maximum age is set, and most clients will consider this a "non-persistent cookie" and will delete it on a condition like exiting a web browser application.

    sameSite

    Specifies the boolean or string to be the value for the SameSite Set-Cookie attribute.

    • true will set the SameSite attribute to Strict for strict same site enforcement.
    • false will not set the SameSite attribute.
    • 'lax' will set the SameSite attribute to Lax for lax same site enforcement.
    • 'strict' will set the SameSite attribute to Strict for strict same site enforcement. More information about the different enforcement levels can be found in the specification https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1.1 Note: This is an attribute that has not yet been fully standardized, and may change in the future. This also means many clients may ignore this attribute until they understand it.
    secure

    Specifies the boolean value for the [Secure Set-Cookie attribute][rfc-6266-5.2.5]. When truthy, the Secure attribute is set, otherwise it is not. By default, the Secure attribute is not set. note be careful when setting this to true, as compliant clients will not send the cookie back to the server in the future if the browser does not have an HTTPS connection.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. var domain: UndefOr[String]

    Permalink

    Specifies the value for the Domain Set-Cookie attribute.

    Specifies the value for the Domain Set-Cookie attribute. By default, no domain is set, and most clients will consider the cookie to apply to only the current domain.

  7. var encode: UndefOr[Function]

    Permalink

    Specifies a function that will be used to encode a cookie's value.

    Specifies a function that will be used to encode a cookie's value. Since value of a cookie has a limited character set (and must be a simple string), this function can be used to encode a value into a string suited for a cookie's value. The default function is the global ecodeURIComponent, which will encode a JavaScript string into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range.

  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. var expires: UndefOr[String]

    Permalink

    Specifies the Date object to be the value for the Expires Set-Cookie attribute.

    Specifies the Date object to be the value for the Expires Set-Cookie attribute. By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and will delete it on a condition like exiting a web browser application. Note: the cookie storage model specification states that if both expires and magAge are set, then maxAge takes precedence, but it is possible not all clients by obey this, so if both are set, they should point to the same date and time.

  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. var httpOnly: UndefOr[Boolean]

    Permalink

    Specifies the boolean value for the [HttpOnly Set-Cookie attribute][rfc-6266-5.2.6].

    Specifies the boolean value for the [HttpOnly Set-Cookie attribute][rfc-6266-5.2.6]. When truthy, the HttpOnly attribute is set, otherwise it is not. By default, the HttpOnly attribute is not set. Note: be careful when setting this to true, as compliant clients will not allow client-side JavaScript to see the cookie in document.cookie.

  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  18. var maxAge: UndefOr[JsNumber]

    Permalink

    Specifies the number (in seconds) to be the value for the Max-Age Set-Cookie attribute.

    Specifies the number (in seconds) to be the value for the Max-Age Set-Cookie attribute. The given number will be converted to an integer by rounding down. By default, no maximum age is set. Note: the cookie storage model specification states that if both expires and magAge are set, then maxAge takes precedence, but it is possiblke not all clients by obey this, so if both are set, they should point to the same date and time.

  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. var path: UndefOr[String]

    Permalink

    Specifies the value for the Path Set-Cookie attribute.

    Specifies the value for the Path Set-Cookie attribute. By default, the path is considered the "default path". By default, no maximum age is set, and most clients will consider this a "non-persistent cookie" and will delete it on a condition like exiting a web browser application.

  23. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  24. var sameSite: UndefOr[|[Boolean, String]]

    Permalink

    Specifies the boolean or string to be the value for the SameSite Set-Cookie attribute.

    Specifies the boolean or string to be the value for the SameSite Set-Cookie attribute.

    • true will set the SameSite attribute to Strict for strict same site enforcement.
    • false will not set the SameSite attribute.
    • 'lax' will set the SameSite attribute to Lax for lax same site enforcement.
    • 'strict' will set the SameSite attribute to Strict for strict same site enforcement. More information about the different enforcement levels can be found in the specification https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1.1 Note: This is an attribute that has not yet been fully standardized, and may change in the future. This also means many clients may ignore this attribute until they understand it.
  25. var secure: UndefOr[Boolean]

    Permalink

    Specifies the boolean value for the [Secure Set-Cookie attribute][rfc-6266-5.2.5].

    Specifies the boolean value for the [Secure Set-Cookie attribute][rfc-6266-5.2.5]. When truthy, the Secure attribute is set, otherwise it is not. By default, the Secure attribute is not set. note be careful when setting this to true, as compliant clients will not send the cookie back to the server in the future if the browser does not have an HTTPS connection.

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped