HTML5的localStorage数据库通常是大小有限的 – 每个域的标准大小是5或10 MB。这些限制是否可以由子域名规避(例如,example.com,hack1.example.com和hack2.example.com都有自己的5 MB数据库)?并且在标准中有什么规定父域是否可以访问他们的孩子的数据库?我找不到任何东西,我可以看到以任何一种方式做的参数,但似乎需要一些标准模型。
解决方法
从
http://dev.w3.org/html5/webstorage/#disk-space
A mostly arbitrary limit of five megabytes per origin is recommended. Implementation Feedback is welcome and will be used to update this suggestion in the future.
它还提到:
User agents should guard against sites storing data under the origins other affiliated sites,e.g. storing up to the limit in a1.example.com,a2.example.com,a3.example.com,etc,circumventing the main example.com storage limit.