UnbluCookie

public struct UnbluCookie : Equatable, Hashable

A struct representing HTTPCookies to be used within Unblu. Use this when you want to pass your own Cookies to Unblu when configuring the SDK.

There are 2 ways to initialize an UnbluCookie:

  1. You can initialize by passing in an HTTPCookie
  2. You can initialize by passing in individual properties.

Both approaches are equally valid.

  • Initializes the UnbluCookie using specific properties.

    Initializing an UnbluCookie like so:

     UnbluCookie(name: "id", value: "123")
     // when passed in an HTTP request yields "id=123"
    

    Declaration

    Swift

    public init(name: String, value: String, expiryDate: Date? = nil)

    Parameters

    name

    The “name” of the Cookie.

    value

    The “value” of the Cookie.

    expiryDate

    The “expiresDate” of the Cookie.

  • Initializes the UnbluCookie with an HTTPCookie.

    Declaration

    Swift

    public init(httpCookie: HTTPCookie)

    Parameters

    httpCookie

    The HTTPCookie to initialize the object with.