Is there a limit to the key length for localStorage?

HtmlLocal Storage

Html Problem Overview


Is there any limit (up to the amount of local storage available) for the key when using localStorage?

i.e. can I do something like:

localStorage.setItem("pretend that this is a 1MB string", "whatever"); 

Html Solutions


Solution 1 - Html

Yes, the limit is 5MB per domain. Your string can be as long as you want. The total usage must, however, be under 5 MB.

http://dev.w3.org/html5/webstorage/

http://www.stackoverflow.com/questions/2747285/html5-localstorage-restrictions-and-limits

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionchrisView Question on Stackoverflow
Solution 1 - HtmlAniketView Answer on Stackoverflow