Cross Tab WebStorage

0 favourites
  • 6 posts
From the Asset Store
Cross roads
$9.99 USD
Template for a cross roads game, fully documented in comments and video
  • Hello I am trying to share webstorage variables between multiple tabs that are running different projects.

    I set a webstorage key in the first tab on localhost:50000 and then I open up another construct 2 project running on localhost:50001 and I need to be able to access the webstorage variable that I set in the first project but its not letting me.

    I thought that webstorage worked for your whole browser so you can access them from anywhere....... even multiple tabs.

    Why wont this work?

  • im not sure you can access webstorage between projects

  • im not sure you can access webstorage between projects

    i thought webstorage was saved inside the browser

    which means it wouldnt matter which project im in as long as its still in the same browser

  • looking at the manual it looks like it needs to be on the same domain to work and testing locally make it run as separate domains try uploading to a website to test

    Storage per domain

    The WebStorage object associates all stored data with the current domain. For example, all games running on scirra.com share the same data, but games running on facebook.com use a different set of data and cannot access any data saved from scirra.com.

    Most browsers implement a maximum size of the data that can be stored with WebStorage - 5mb is a common limit. If you exceed the limit, the WebStorage's On quota exceeded trigger runs.

  • looking at the manual it looks like it needs to be on the same domain to work and testing locally make it run as separate domains try uploading to a website to test

    Storage per domain

    The WebStorage object associates all stored data with the current domain. For example, all games running on scirra.com share the same data, but games running on facebook.com use a different set of data and cannot access any data saved from scirra.com.

    Most browsers implement a maximum size of the data that can be stored with WebStorage - 5mb is a common limit. If you exceed the limit, the WebStorage's On quota exceeded trigger runs.

    Well then would it work if i hosted my first project on something.com and then the 2nd project on something.com/something

    would the webstorage work like that

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Its reserved to both domain, as well as port.

    http://htmlui.com/blog/2011-08-23-5-obs ... orage.html

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)