title: How to enable LocalStorage on iOS Safari browser on private mode?
body: <p>I am working on project SPA angular app which requires <code>localstorage</code> of browser to store values. We came to notice that iOS doesn't allow to access <code>localstorage</code> on private mode. </p>
  
  <p>We fixed the issue by checking the browser compatibility for <code>localstorage</code>. If it's not allowing local storage we use <code>$rootScope</code> object of AngularJS to store values temporarily.   </p>
  
  <p>Only challenge of this approach is when page is refreshed data will be cleared which make sense as we are using <code>$rootScope</code> which will be destroyed upon page refresh</p>
  
  <p>Here are my questions:</p>
  
  <ol>
  <li>Is their any way to enable <code>localstorage</code> through <code>javascript</code>?</li>
  <li>Is their any better alternative approach? Ideally we want to retain values upon page refresh. How's that possible? (Is it good to use <code>localstorage</code>)</li>
  </ol>
  
  <p>Thanks,
  Gokul </p>