storage.session

Represents the session storage area. Items in session storage are stored in memory for the duration of the browser session and are not persisted to disk. By default, it's not exposed to content scripts, but this behavior can be changed through storage.session.setAccessLevel().

The amount of data that an extension can store in the session storage area is limited to 10 MB, unless stated otherwise in the browser compatibility table.

When the browser stops, all session storage is cleared. When the extension is uninstalled, its associated session storage is cleared.

Properties

storage.session.QUOTA_BYTES

The maximum amount of data (in bytes) that can be stored in session storage.

Methods

The session object implements the methods defined on the storage.StorageArea type:

storage.session.get()

Retrieves one or more items from the storage area.

storage.session.getBytesInUse()

Gets the amount of storage space (in bytes) used for one or more items in the storage area.

storage.session.getKeys()

Retrieves the keys of all items in the storage area.

storage.session.set()

Stores one or more items in the storage area. If the item exists, its value is updated.

storage.session.setAccessLevel()

Sets the access level for the storage area.

storage.session.remove()

Removes one or more items from the storage area.

storage.session.clear()

Removes all items from the storage area.

Events

The session object implements the events defined on the storage.StorageArea type:

storage.session.onChanged

Fires when one or more items in the storage area change.

Example extensions

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
session
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote
footnote Before version 112, storage quota limits were 1MB.
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote
footnote Before version 112, storage quota limits were 1MB.
Firefox – Full support
Firefox 115 (Release date: 2023-07-04)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote
footnote Before version 98, storage quota limits were 1MB.
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 115 (Release date: 2023-07-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
QUOTA_BYTES
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – Full support
Firefox 131 (Release date: 2024-10-01)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 131 (Release date: 2024-10-01)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
clear
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – Full support
Firefox 115 (Release date: 2023-07-04)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 115 (Release date: 2023-07-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
get
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – Full support
Firefox 115 (Release date: 2023-07-04)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 115 (Release date: 2023-07-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Supports empty key
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – Full support
Firefox 115 (Release date: 2023-07-04)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 115 (Release date: 2023-07-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support
getBytesInUse
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – Full support
Firefox 131 (Release date: 2024-10-01)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 131 (Release date: 2024-10-01)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
getKeys
Chrome – Full support
Chrome 130 (Release date: 2024-10-15)
footnote Full support
Edge – Full support
Edge 130 (Release date: 2024-10-17)
footnote Full support
Firefox – Full support
Firefox 143 (Release date: 2025-09-16)
footnote Full support
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 18.4 (Release date: 2025-03-31)
footnote Full support
Firefox for Android – Full support
Firefox for Android 143 (Release date: 2025-09-16)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18.4 (Release date: 2025-03-31)
footnote Full support
onChanged
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – Full support
Firefox 115 (Release date: 2023-07-04)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 115 (Release date: 2023-07-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
remove
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – Full support
Firefox 115 (Release date: 2023-07-04)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 115 (Release date: 2023-07-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Supports empty key
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – Full support
Firefox 115 (Release date: 2023-07-04)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 115 (Release date: 2023-07-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support
set
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – Full support
Firefox 115 (Release date: 2023-07-04)
footnote Full support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 115 (Release date: 2023-07-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
setAccessLevel
Chrome – Full support
Chrome 102 (Release date: 2022-05-24)
footnote Full support
Edge – Full support
Edge 102 (Release date: 2022-05-31)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 88 (Release date: 2022-06-08)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

Note: This API is based on Chromium's chrome.storage API. This documentation is derived from storage.json in the Chromium code.