title: determine whether Web Storage is supported or not
body: <p>I need to verify that Web Storage API is supported and available (it may be disabled due to security issues).</p>
  
  <p>So, I thought it would suffice to check whether the type sessionStorage or localStorage is defined or not:</p>
  
  <pre><code>if (typeof sessionStorage != 'undefined')
  {
      alert('sessionStorage available');
  }
  else
  {
      alert('sessionStorage not available');
  }
  </code></pre>
  
  <p>However, I was wondering if it could be possible that the type exists, but I wouldn't been able to use the Web Storage API anyway.</p>
  
  <p>Remarks:
  I know Firefox will throw a security error if cookies are disabled and sessionStorage or localStorage are accessed.</p>