Software⏱️ 3 min read📅 2026-06-03

How to Fix: QuotaExceededError: Dom exception 22: An attempt was made to add something to storage that exceeded the quota

localStorage issue on iPhone with iOS 7

Quick Answer: Try using the `localStorage` API in a different way, such as by storing data in an object and then converting it to a string before saving.

The QuotaExceededError: Dom exception 22 error occurs when an attempt is made to add data to LocalStorage on iPhone with iOS 7, resulting in the storage quota being exceeded. This issue affects users who rely on LocalStorage for storing data, making it a frustrating experience.

Understanding why this error happens can be challenging, as it may not be directly related to browsing in private mode. However, since no other websites exhibit the same issue, it's possible that the problem is specific to iOS 7 and LocalStorage.

🛑 Root Causes of the Error

  • The primary reason for this error is the default quota limitations imposed by Apple on LocalStorage in iOS 7. These limitations are intended to prevent excessive storage usage and potential security risks. As a result, when the allocated quota is reached, an error occurs.
  • An alternative reason could be that the issue might be related to the way LocalStorage is implemented or utilized within specific websites or applications.

✅ Best Solutions to Fix It

Enabling LocalStorage Quota Exemptions

  1. Step 1: To resolve this issue, you can try enabling LocalStorage quota exemptions for your website. To do so, add the following meta tag to the head of your HTML document: This will allow LocalStorage to bypass its default quota limitations.
  2. Step 2: Alternatively, you can also use the `localStorage` API's `setQuota()` method to manually set a custom quota limit for your application. For example: localStorage.setQuota(10000000);
  3. Step 3: Keep in mind that enabling LocalStorage quota exemptions or setting a custom quota limit may have implications for security and performance.

Using Alternative Storage Solutions

  1. Step 1: If enabling LocalStorage quota exemptions is not feasible, you can explore alternative storage solutions such as IndexedDB, SessionStorage, or even server-side storage options.
  2. Step 2: Consider using IndexedDB to store data locally on the device, which may offer more flexibility and control over storage limitations.

🎯 Final Words

In conclusion, the QuotaExceededError: Dom exception 22 error can be resolved by enabling LocalStorage quota exemptions or using alternative storage solutions. By understanding the root causes of this issue and implementing one of these fixes, you should be able to overcome the quota limitation restrictions imposed by iOS 7 on LocalStorage.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions