Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Localstorage

 Post Reply Post Reply
Author
Pfau Dr. Peter View Drop Down
New Member
New Member
Avatar

Joined: 31 Mar 2012
Posts: 20
Post Options Post Options   Quote Pfau Dr. Peter Quote  Post ReplyReply Direct Link To This Post Topic: Localstorage
    Posted: 01 Sep 2018 at 5:09pm
I want to store data in the localstorage of the browser and use them later on in other sessions with different URLs. For example under URL1 a few strings are stored in localstorage and under URL2 these strings are read from localstorage. I think this is a typical usage of localstorage.

This runs perfect if the reading session(URL2) is started manually or with a new browser instance.
I can read all the stored strings.

The problems arises if the second session is not started manually but via a call of
application.navigate(URL2,ntblank) or application.navigate(URL2,ntpage) in the code of URL1.
Then URL2 comes up, everything seems to be ok, but when i read from localstorage all strings are empty.  Why ?

May be it is necessary to force the browser to reload storage ?
I tested it with Webcore 1.0.3.0 and IIS

regards 
Peter






Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8408
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 02 Sep 2018 at 10:40am
Do URL1 and URL2 belong to the same domain?
This article might be worth reading:
Back to Top
Pfau Dr. Peter View Drop Down
New Member
New Member
Avatar

Joined: 31 Mar 2012
Posts: 20
Post Options Post Options   Quote Pfau Dr. Peter Quote  Post ReplyReply Direct Link To This Post Posted: 03 Sep 2018 at 1:41pm
URL1 and URL2 are on the same machine in the same domain.
Just 2 directories on the same IIS.

Tested with browser Safari on Iphone and Ipad
with Chrome on Windows 10 prof (64)





Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8408
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 03 Sep 2018 at 10:00pm
Maybe it is due to a same origin setting in IIS
https://stackoverflow.com/questions/4201239/in-html5-is-the-localstorage-object-isolated-per-page-domain
I cannot see our class for accessing localStorage to be responsible for this.
Back to Top
Pfau Dr. Peter View Drop Down
New Member
New Member
Avatar

Joined: 31 Mar 2012
Posts: 20
Post Options Post Options   Quote Pfau Dr. Peter Quote  Post ReplyReply Direct Link To This Post Posted: 04 Sep 2018 at 12:15am
Thank you very very much !!!!
This was the important tip and link.
It's my mistake.

Starting manual and via application.navigate in fact called different pages.
One used the computername in the domain, the other sometime used the ip-address.
This leads to the same computer, but the IIS treats them as different pages and therefore 
maps a different localstorage.








Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8408
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 04 Sep 2018 at 8:54am
Thanks for informing
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down