Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Cookie(name, value, path, maxAge, isSecure)

Creates a new instance of the Cookie class using the specified name, value, path, age, and the secure setting.

Signature

public Cookie(String name, String value, String path, Integer maxAge, Boolean isSecure)

Parameters

  • name:

    Type: String

    The cookie name. It can’t be null.

  • value:

    Type: String

    The cookie data, such as session ID.

  • path:

    Type: String

    The path from where you can retrieve the cookie.

  • maxAge:

    Type: Integer

    A number representing how long a cookie is valid for in seconds. If set to less than zero, a session cookie is issued. If set to zero, the cookie is deleted.

  • isSecure:

    Type: Boolean

    A value indicating whether the cookie can only be accessed through HTTPS (true) or not (false).