---
title: "Delete Local Session Data"
url: "https://developer.incode.com/sdk-reference/cordova-delete-local-session-data/"
section: "sdk-reference"
group: "Cordova SDK / Cordova Getting Started"
version: "v1.1"
status: "live"
---
# Delete Local Session Data

Delete all local user data that was collected during onboarding from the device by calling `deleteUserLocalData()`.&#x20;
Use this method after onboarding completes to clear session data on the device, or when complying with data retention requirements.

## When to call `deleteUserLocalData()`

### End-to-end flows (`startOnboarding()`, `startFlow()`, `startWorkflow()`)

Call `deleteUserLocalData()` in the success or error callback of the final flow/section call, after the user has finished or abandoned the flow.

### Section-based flows (`startOnboardingSection()`)

Do not call `deleteUserLocalData()` before `finishOnboarding()` or between sections. Calling it too early prevents the onboarding session from completing. Call it only after `finishOnboarding()` succeeds.

### Example

```javascript
cordova.exec(
  function () { console.log("Local data deleted"); },
  function (err) { console.log("deleteUserLocalData error:", err); },
  "Cplugin",
  "deleteUserLocalData",
  []
);
```

There is no structured result payload, only success/failure via the standard Cordova callbacks. The success callback confirms deletion completed; the error callback fires if deletion fails.&#x20;

<br />