Cross Tab WebStorage

Get help using Construct 2

Post » Tue Apr 07, 2015 5:53 am

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?
B
3
Posts: 9
Reputation: 195

Post » Tue Apr 07, 2015 6:05 am

im not sure you can access webstorage between projects
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Tue Apr 07, 2015 6:19 am

volkiller730 wrote: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
B
3
Posts: 9
Reputation: 195

Post » Tue Apr 07, 2015 6:36 am

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.
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Tue Apr 07, 2015 6:53 am

volkiller730 wrote: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
B
3
Posts: 9
Reputation: 195

Post » Tue Apr 07, 2015 6:59 am

Its reserved to both domain, as well as port.
http://htmlui.com/blog/2011-08-23-5-obs ... orage.html
Image Image
B
164
S
49
G
111
Posts: 7,622
Reputation: 77,943


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests