title: Alternatives to store data with Javascript
body: <p>Im writing a browser plugin that needs to store a time variable specific to the user. Only thing is the js file which needs the data is "on every page" and cant really do local storage.
  I need some direction for some alternatives for this.</p>
  
  <p>Let me explain a little further how things work.</p>
  
  <p><strong>Plugin Structure</strong></p>
  
  <ul>
  <li><p>The plugin calls a javascript file from my server on specific websites - called appScript.js</p></li>
  <li><p>appScript.js is our main file and places an image on the chosen websites. When the image is clicked it calls an iFrame called iframe.php which has a main.js file with it.</p></li>
  <li><p>From the iFrame users connect to facebook and we pull their facebook ID and send the information to a php script which stores some data on a mysql table. Each users informations is located on the mySQL using their facebook ID as an index.</p></li>
  </ul>
  
  <p>appScript.js needs to save a variable specific to the user.</p>
  
  <p><strong>My thought of alternatives</strong></p>
  
  <ul>
  <li><p>Store data locally - when i use local storage on the appScript.js it stores the data specific to the url and thus cant be accessed when the appScript.js is called on a different url.</p></li>
  <li><p>Store it on my server - It is possible, but hopefully theres a better route to go down because I want the plugin to affect browsing speed as little as possible unless the image is clicked and the iframe called.(South african speeds aren't too quick). How it would work is it would have to connect to facebook, call the users ID, then send it to the server, wait for the response and then act on it, this could take time and slow down users browsing experience.</p></li>
  <li><p>Store the data on the iFrame.php some how - well i need the data before the iFrame is called, so that cant happen.</p></li>
  <li><p>I thought of dynamically loading an invisible iFrame onto the page which could use local storage because it would save it under my servers URL and thus be accessible on any page. Only issue is that i havent successfully been able to call data from a variable held on the iFrame with the appScript.js which isnt in an iframe. (if this in possible could someone maybe point me out to a working example. I've read up code but havent been able to implement it successfully)</p></li>
  </ul>
  
  <p>I'm stumped - what else can i do? any ideas? i've run out of keywords to google and techniques to learn.</p>