[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/inertia](../README) / clearHistory

# Function: clearHistory()

> **clearHistory**(): `void`

Defined in: [inertia/src/historyState.ts:69](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/inertia/src/historyState.ts#L69)

Clear any previously encrypted history state — call on logout so cached page data
can't be recovered via the browser Back button.

## Returns

`void`

## Example

```ts
async destroy(http: HttpContext): Promise<void> {
  await Auth.logout();
  Inertia.clearHistory();
  return redirect('/login');
}
```
