View and edit session storage
To view, edit, and delete sessionStorage key-value pairs, use the Application tool.
View sessionStorage keys and values
To view the sessionStorage
key-value pairs of a domain:
In DevTools, click the Application tab to open the Application tool. The Manifest panel is shown by default:
In the Storage section on the left, expand Session storage:
In the Session storage on the left, select a domain. The domain's key-value pairs are listed in the upper right:
Select a row of the key-value table. The value for the selected key is displayed below the key-value table:
Create a new sessionStorage key-value pair
To add a new key/value pair for session storage:
In DevTools, in the Application tool, in the Storage section on the left, expand Session storage, and then select a domain. For details, see View sessionStorage keys and values, above.
In the Key/Value table on the right, double-click an empty key/value row, to enter editing mode.
In the Key field of the row, enter a key.
In the Value field of the row, enter a value for the key.
Press Enter, or click an empty area. The value is then also displayed below the key/value table:
Edit sessionStorage keys or values
To edit a key/value pair for session storage:
In DevTools, in the Application tool, in the Storage section on the left, expand Session storage, and then select a domain. For details, see View sessionStorage keys and values, above.
In the Key/Value table on the right, double-click a cell in the Key or Value column to edit that key or value:
Delete sessionStorage key-value pairs
To delete a key/value pair for session storage:
In DevTools, in the Application tool, in the Storage section on the left, expand Session storage, and then select a domain. For details, see View sessionStorage keys and values, above.
In the Key/Value table on the right, select a key-value pair to highlight it.
Press
Delete
, or click the Delete Selected () button, or right-click the row and then select Delete.
Delete all sessionStorage key-value pairs for a domain
To delete all key/value pairs for session storage for a domain:
In DevTools, in the Application tool, in the Storage section on the left, expand Session storage, and then select a domain. For details, see View sessionStorage keys and values, above.
Click the Clear All () button.
Interact with sessionStorage from the Console
You can run JavaScript expressions and statements in the Console, and the Console has access to the JavaScript contexts of the page, including for sessionStorage
.
To interact with sessionStorage
by using the Console:
In DevTools, select the Console tool. For example, press Esc to display the Quick View panel, which always includes a Console tab.
If you want to access the
sessionStorage
key-value pairs of a domain other than the page you're on, use the JavaScript contexts menu to change the JavaScript context of the Console:In this scenario, there would be multiple domains listed below top.
Enter
sessionStorage
JavaScript expressions in the Console:The above screenshot shows the following JavaScript expressions, and the resulting output:
> sessionStorage.key(0) <· 'my-key-01' > sessionStorage.key(1) <· 'my-key-02' > sessionStorage.setItem("my-key-01", "efgh-5678") <· undefined > sessionStorage.getItem("my-key-01") <· 'efgh-5678'
When you enter JavaScript assignment expressions by using the Console, the Key/Value pair table is updated.
Note
Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons Attribution 4.0 International License. The original page is found here and is authored by Kayce Basques (Technical Writer, Chrome DevTools & Lighthouse).
This work is licensed under a Creative Commons Attribution 4.0 International License.