Persisted Variables

The value of a variable can be persisted on the history, for the current session or across sessions.

If you set "persisted" to "history", the variable value is stored in the browser history. When navigating back to a page in the browser history using the browser back button or when refreshing the page, the value of the variable is restored to its value at the time the application navigated away from this page.

If you set "persisted" to "session", the variable is stored in the browser session storage as long as the browser is open. To store a variable across sessions, use "device" instead of "session".

If you set "persisted" to "device", the variable is stored in the browser local storage, so it is persisted on the device where the application is running even if the browser is closed.

To remove a variable from storage, set its value to null.

Example 1-16 Using a Persisted Variable

"variables": {
  "sessionToken": {
    "type": "string",
    "persisted": "session"
  }
}