#9614·kit

Option to clear Snapshot from sessionStorage

Author: hfournierCreated Apr 7, 2023Updated Sep 27, 2026
Labelsrouter

Describe the problem

When using a Snapshot to store <form> <input> values when the user navigates away, there currently is no way of clearing those values from sessionStorage. In fact, the docs contain a warning regarding same.

Avoid returning very large objects from capture — once captured, objects will be retained in memory for the duration of the session, and in extreme cases may be too large to persist to sessionStorage.

After a <form> has successfully been submitted, there is no reason to keep these values in sessionStorage.

Describe the proposed solution

We would need access to a key so we can call sessionStorage.removeItem(key); or some other method of clearing the data from sessionStorage.

Alternatives considered

No response

Importance

nice to have

Additional Information

I'm currently using BeforeNavigate and AfterNavigate to save, restore and clear my own snapshots to avoid this issue.