Firefox Tomorrow

web api instance property

StorageAccessHandle: sessionStorage property

View on MDN ↗

The sessionStorage property of the StorageAccessHandle interface returns an unpartitioned session Storage object if access was granted, and throws a SecurityError DOMException otherwise.

Value

A Storage object.

Examples

document.requestStorageAccess({ sessionStorage: true }).then(
  (handle) => {
    console.log("sessionStorage access granted");
    handle.sessionStorage.setItem("foo", "bar");
  },
  () => {
    console.log("sessionStorage access denied");
  },
);

[!NOTE] See Using the Storage Access API for a more complete example.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also