I’ve begun creating web apps that use localStorage, and since the data stored here persists over multiple browser sessions and pages, I was wondering how long this data lasts for? I only need to store data in there for at most, a month, and definitely I do not want it to be stored indefinitely.
So, does the data eventually clear automatically or will I also have to take into account clearing it myself? Also, I’m guessing there must be some security in place, so that I can’t just put localStorage.clear() in my code (I’m currently typing this in Firebug when I need it).
I don’t know about a limit (probably a setting in the browser), but localStorage is forever
http://www.w3schools.com/html5/html5_webstorage.asp
Not 100% sure, but this might be the firefox setting:
http://kb.mozillazine.org/Dom.storage.default_quota
As for security, according to the article you linked that should be by domain (i.e. not being allowed to touch higher level domains in FF3+ ).