---
id: api/commands/clearallsessionstorage
title: clearAllSessionStorage | Cypress Documentation
description: Clear all session storage data in Cypress.
section: api
source_path: docs/api/commands/clearallsessionstorage.mdx
version: 48b03b5502f7aea1d0454750cce208f775403542
updated_at: '2026-05-20T19:00:20.270Z'
---
# clearAllSessionStorage

Clear [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage) data for all origins with which the test has interacted.

Cypress automatically clears all session storage _before_ each test to prevent state from being shared across tests when [test isolation](/llm/markdown/app/core-concepts/writing-and-organizing-tests.md#Test-Isolation) is enabled. You shouldn't need to use this command unless you're using it to clear sessionStorage inside a single test or test isolation is disabled.

## Syntax

```
cy.clearAllSessionStorage()cy.clearAllSessionStorage(options)
```

### Usage

**Correct Usage**

```
cy.clearAllSessionStorage()
```

### Arguments

**options _(Object)_**

Pass in an options object to change the default behavior of `cy.clearAllSessionStorage()`.

| Option | Default | Description |
| --- | --- | --- |
| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |

### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)

*   `cy.clearAllSessionStorage()` yields `null`.

## Rules

### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)

*   `cy.clearAllSessionStorage()` requires being chained off of `cy`.

### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)

`cy.clearAllSessionStorage()` cannot have any assertions chained.

### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)

*   `cy.clearAllSessionStorage()` cannot time out.

## See also

*   [`cy.clearAllLocalStorage()`](/llm/markdown/api/commands/clearalllocalstorage.md)
*   [`cy.clearCookies()`](/llm/markdown/api/commands/clearcookies.md)
*   [`cy.clearLocalStorage()`](/llm/markdown/api/commands/clearlocalstorage.md)
*   [`cy.getAllLocalStorage()`](/llm/markdown/api/commands/getalllocalstorage.md)
*   [`cy.getAllSessionStorage()`](/llm/markdown/api/commands/getallsessionstorage.md)
