1

If I'm not wrong then I know that local storage is saved in the context of browser memory. Now how is it saved?

Suppose I saved something like from one application.

localStorage.setItem("myvariable",'123');

Will it be available in other application? If two applications used the same name how is it separated one from the other? How applications understand that this variable is mine and this is not? 2 separate pages can use the variable set by the same application. How?

I can't find any suitable explanation and architecture regarding this issue.

AtanuCSE
  • 8,290
  • 13
  • 67
  • 103
  • may be this links will help your cause. [link1](http://stackoverflow.com/questions/4201239/in-html5-is-the-localstorage-object-isolated-per-page-domain), [link2](http://jcubic.wordpress.com/2014/06/20/cross-domain-localstorage/) – frank Dec 28 '14 at 08:59

1 Answers1

0

As per my understanding and the below links the localstorage is domain based.
Refer link link1, link2.

i.e Any application that refer to the same domain www.domain.com will have access to the localstorage set by it.

2 separate pages can use the variable set by the same application. How?

Separate pages will be able to access the localstorage variables as per the above rule if the belong to the same domain.
The locatstorage is implemented by the browser which provides you the APIs for accessing/manipulating the localstorage.

Even though the above explanation is for a browser APP, the rule still holds true for cordova APP, as the cordova APP is based on a Webview.

Community
  • 1
  • 1
frank
  • 3,120
  • 3
  • 14
  • 18
  • Cordova apps doesn't have domains, then how local storage is separated? How browser knows that this comes from app 1 and this comes from app 2! – AtanuCSE Dec 28 '14 at 12:30