> ## Documentation Index
> Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Clearing Sessions

> Learn how to clear all locally stored Suki sessions from the device in the mobile SDK

<div className="quick-summary-wrapper">
  <div className="quick-summary-header">
    <span className="quick-summary-icon" aria-hidden="true" />

    <span className="quick-summary-title">Quick summary</span>
  </div>

  <div className="quick-summary-content">
    The `clear()` method removes all locally stored Suki sessions from the device. The primary use case is to clear user-specific data when a user signs out of your application, ensuring data privacy and preparing the SDK for a new user session.

    <br />

    <br />

    You cannot call `clear()` during an active session; it will throw an error. Always ensure no sessions are active before calling this method.
  </div>

  <div className="quick-summary-footer">
    <span className="quick-summary-footer-icon" aria-hidden="true" />

    <span className="quick-summary-footer-text">Last updated:</span>
    <span className="quick-summary-footer-date">June 2026</span>
  </div>
</div>

**What will you learn?**

In this guide, you will learn how to:

* Clear all locally stored Suki sessions from the device by calling the `clear()` method.
* Handle errors from the `clear()` method.

## Clear all sessions

Remove all locally stored Suki sessions from the device by calling the `clear()` method.

The primary use case for this method is to **clear user-specific data** when a user **signs out** of your application. This ensures data privacy and prepares the SDK for a new user session.

<Warning>
  Do not call the `clear()` method during an **active session**; this will throw an error.
</Warning>

<CodeGroup>
  ```swift Swift theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
  do {
      // Removes all persisted session data from the device.
      try SukiAmbientCore.shared.clear()
  } catch {
      // Handle potential errors.
      print(error)
  }
  ```
</CodeGroup>

## FAQs

<AccordionGroup>
  <Accordion title="Why can't I call the `clear()` method during an active session?">
    The `clear()` method is used to clear all locally stored Suki sessions from the device. If you call this method during an active session, it will throw an error.
  </Accordion>

  <Accordion title="`clear()` method is not working">
    The `clear()` method is not working because the SDK is not initialized. You must ensure that the SDK is initialized before calling the `clear()` method.
  </Accordion>

  <Accordion title="How do I know if the `clear()` method has been called?">
    Check the `sessionState` property to determine the current state of the session.
  </Accordion>

  <Accordion title="`clear()` method is clearing all sessions but the data is not being deleted">
    The data is not being deleted because the SDK is not initialized. You must ensure that the SDK is initialized before calling the `clear()` method.
  </Accordion>

  <Accordion title="How to Initialize the SDK?">
    Initialize the SDK by calling the `initialize()` method.
  </Accordion>
</AccordionGroup>

## Next steps

<Icon icon="file-lines" iconType="solid" /> After you clear the sessions, proceed to our [Session events & delegates](/mobile-sdk/ambient-guides/events-and-delegates) guide to listen to the session events.
