Q:

Passing Self-Refreshing Changing Variable

I'm making a web application that lets people, with an invitation, track other people. I'm using javascript geolocation. I need a variable that passes to another page, but also needs to be refreshed every five seconds or so. All this is done only when the person who is being tracked is on the first page. A database accessed with ajax and the variable changing every five seconds seems like overkill.
Thanks in advance!

A:

Try localStorage
https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
That will store data into the browser, but associated with that particular URL.  So the page can always access it.  
If that doesn't fit the bill, look into sessionStorage or indexedDB.
https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API

