Search code examples
javascriptsession-storagebrave

Brave Browser sessionStorage error. How to solve?


Brave browser is returning this message:

Uncaught DOMException: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.

The related code is:

sessionStorage.setItem("status", 0);

Why is that? How do I solve the problem? In other browser (Safari, Chrome) the sessionStorage works fine.


Solution

  • You are trying to access the storage from a frame or an iframe with different origins.

    For security reasons, Brave blocks those requests.

    You can configure your shields and allow cross site cookies.