Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

localStorage reach maximum size while there are only 800 Kb data in it.

  • 1 reply
  • 4 have this problem
  • 120 views
  • Last reply by mileskunta

more options

I met an localStorage exception when I call API "localStorage.setItem()"

we are developing a web site, we used host like aaaa.bb.com the case is :
the local storage has about 560KB Data in localstorage and then I want to set an item into localStorage, the size of the new item is 301KB
then the browser throw exception, the content of the exception is as follows:

The way I used to test the size of localStorage is: JSON.stringify(localStorage).length

"Persistent Storage maximum size reached" code:"1014" nsresult: "0x80530f6(NS_ERROR_DOM_QUOTA_REACHED)"

I tested this function in other machines and in chrome, this exception will not occur, I want to know why this exception occurs on the machine, if there is any settings in firefox? or if there is any relationship with the cache size?

I met an localStorage exception when I call API "localStorage.setItem()"<br> we are developing a web site, we used host like aaaa.bb.com the case is :<br> the local storage has about 560KB Data in localstorage and then I want to set an item into localStorage, the size of the new item is 301KB<br> then the browser throw exception, the content of the exception is as follows:<br> <br> The way I used to test the size of localStorage is: JSON.stringify(localStorage).length<br> <br> "Persistent Storage maximum size reached" code:"1014" nsresult: "0x80530f6(NS_ERROR_DOM_QUOTA_REACHED)"<br><br> I tested this function in other machines and in chrome, this exception will not occur, I want to know why this exception occurs on the machine, if there is any settings in firefox? or if there is any relationship with the cache size?

Chosen solution

the root cause is found.

the reason is that aaa.domain.com and bbb.domain.com, the two sub domain will share the same space of localStorage because they are under the same top level domain domain.com.

aaa.domain.com reach maximum size when there is only 500KB data in localStorage because there is already 4.5MB data in localStorage of bbb.domain.com.

Read this answer in context 👍 4

All Replies (1)

more options

Chosen Solution

the root cause is found.

the reason is that aaa.domain.com and bbb.domain.com, the two sub domain will share the same space of localStorage because they are under the same top level domain domain.com.

aaa.domain.com reach maximum size when there is only 500KB data in localStorage because there is already 4.5MB data in localStorage of bbb.domain.com.