title: What happens when localStorage is full?
body: <p>I have found <a href="http://code.google.com/speed/page-speed/docs/caching.html" rel="noreferrer">articles</a> regarding cache behaviour so I can only assume that it's not much different but I wanted to make sure.</p>
  <p>I have read that most browser have 5MB (give or take) for localStorage and I was interested in what would be the behaviour of the browsers?</p>
  <p>I understand every browser acts differently but I'm interested mostly in Safari, Chrome and Firefox (as those are the ones I consider as browsers).</p>
  <ul>
  <li>Will the browsers mentioned above delete data from my website or it will choose &quot;the oldest&quot; or something of the sort?</li>
  <li>Will my item be saved in such case?</li>
  </ul>
  <p><strong>And the most important :</strong></p>
  <ul>
  <li><p>Lets say I &quot;abuse&quot; the localStorage on my website trying to use it all up, and in the same page I'm filling it up and trying to save more. Will I get a warning? Will the <code>getItem</code> return <code>null</code> when this happens or is it somehow saved in memory?</p>
  </li>
  <li><p>What happens if I try and save an item larger than the <code>localStorage</code> size?</p>
  </li>
  </ul>
  <p><strong>Answered:</strong>  answer can be found <a href="https://stackoverflow.com/questions/12508274/does-amplify-store-return-error-or-catch-exception-when-local-storage-limit-exce">here</a></p>
  <ul>
  <li>Can the same exact behaviour be expected from sessionStorage which allegedly should be the same?</li>
  </ul>
  <p>I know this is a lot of questions but I'm trying to understand all that's related to the subject, I'd be thankful for any part of the question you can answer.</p>