Figuring out sessionStorage size limit of a browser

I was able to figure out the size of sessionStorage that is used by my app using the following line of code in console. I used the following code from the first answer of this stack overflow post I just had to change it from localStorage to sessionStorage in my case.


var _lsTotal = 0,
    _xLen, _x;
for (_x in sessionStorage) {
    if (!sessionStorage.hasOwnProperty(_x)) {
        continue;
    }
    _xLen = ((sessionStorage[_x].length + _x.length) * 2);
    _lsTotal += _xLen;
    console.log(_x.substr(0, 50) + " = " + (_xLen / 1024).toFixed(2) + " KB")
};
console.log("Total = " + (_lsTotal / 1024).toFixed(2) + " KB");

My firefox browser is currently holding 9.5 MB of session storage data.

I am wondering how firefox is able to handle it since I keep reading that the default size in 5 MB. How long it is going to be before firefox or any other browser is going to give up on this if the size of sessionStorage keeps on increasing.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.