X
Tap here to go to the mobile version of the site.

Support Forum

Local Storage is not stored value.

Posted

firefox 67.0.3 (android) firefox 68.0b14 (android) (opera 52.4.2517.140781 (android))

Local Storage is not stored value. Wrote a simple example. It shows the current value of 'LS'. Went clicked in the monitor. The value of 'LS' has changed . Closed the browser - opened and the value 'LS' is not preserved.

<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <meta content="index, follow" name="robots"> <meta content="width=device-width, initial-scale=1.0" name="viewport"> <meta content="" name="copyright"> <meta content="" name="keywords"> <meta content="localstprage" name="description"> <title>localstoragetest</title> <style> *{margin: 0px; padding: 0px;} #iphone, #android{font-size: 28px;} #del{width: 50px; height: 50px; float: right; background-color: green;} </style> <script> window.addEventListener('click', function(e) // срабатывает при загрузке страницы БЕЗ CSS { "use strict"; var id = e.target.id; var iphone = document.getElementById("iphone"); var cur_LS = localStorage.getItem("test"); if (cur_LS === "123") {localStorage.setItem("test","ABC");} if (cur_LS === "ABC") {localStorage.setItem("test","123");} if (cur_LS === null) {localStorage.setItem("test","ABC");} if (id === "del") {localStorage.removeItem("test");} cur_LS = localStorage.getItem("test"); iphone.textContent = "set_new = "+cur_LS; }); window.addEventListener('DOMContentLoaded', function() // срабатывает при загрузке страницы БЕЗ CSS { "use strict"; var android = document.getElementById("android"); var cur_LS = localStorage.getItem("test"); android.textContent = "read "+cur_LS; }); </script>

read
new
DEL_LS

firefox 67.0.3 (android) firefox 68.0b14 (android) (opera 52.4.2517.140781 (android)) Local Storage is not stored value. Wrote a simple example. It shows the current value of 'LS'. Went clicked in the monitor. The value of 'LS' has changed . Closed the browser - opened and the value 'LS' is not preserved. <!DOCTYPE html> <html lang="ru"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="robots" content="index, follow"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="copyright" content=""> <meta name="keywords" content=""/> <meta name="description" content="localstprage"/> <title>localstoragetest</title> <style> *{margin: 0px; padding: 0px;} #iphone, #android{font-size: 28px;} #del{width: 50px; height: 50px; float: right; background-color: green;} </style> <script> window.addEventListener('click', function(e) // срабатывает при загрузке страницы БЕЗ CSS { "use strict"; var id = e.target.id; var iphone = document.getElementById("iphone"); var cur_LS = localStorage.getItem("test"); if (cur_LS === "123") {localStorage.setItem("test","ABC");} if (cur_LS === "ABC") {localStorage.setItem("test","123");} if (cur_LS === null) {localStorage.setItem("test","ABC");} if (id === "del") {localStorage.removeItem("test");} cur_LS = localStorage.getItem("test"); iphone.textContent = "set_new = "+cur_LS; }); window.addEventListener('DOMContentLoaded', function() // срабатывает при загрузке страницы БЕЗ CSS { "use strict"; var android = document.getElementById("android"); var cur_LS = localStorage.getItem("test"); android.textContent = "read "+cur_LS; }); </script> </head> <body> <div><span id="android">read</span></div> <div><span id="iphone">new</span></div> <div id="del">DEL_LS</div> </body> </html>
Quote

Additional System Details

Installed Plug-ins

no plugins installed

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170

More Information

TyDraniu
  • Top 25 Contributor
309 solutions 1719 answers

Can you provide a working example of the issue on https://jsfiddle.net/ or https://codepen.io/ ?

Can you provide a working example of the issue on https://jsfiddle.net/ or https://codepen.io/ ?
Was this helpful to you?
Quote

Question owner

yeah, sure. here you go. link text (I'm running my tests on Denver.)

yeah, sure. here you go. [https://codepen.io/Pavel_V/pen/xoQwqr link text] (I'm running my tests on Denver.)
Was this helpful to you?
Quote

Question owner

vipmaster-05 said

yeah, sure. here you go. link text (I'm running my tests on Denver.)

on, 'codepen' too, not works now tried. if you need video error record.

''vipmaster-05 [[#answer-1235659|said]]'' <blockquote> yeah, sure. here you go. [https://codepen.io/Pavel_V/pen/xoQwqr link text] (I'm running my tests on Denver.) </blockquote> on, 'codepen' too, not works now tried. if you need video error record.
Was this helpful to you?
Quote
TyDraniu
  • Top 25 Contributor
309 solutions 1719 answers

I can't really reproduce the issue. It's always "read ABC" after opening the browser.

I can't really reproduce the issue. It's always "read ABC" after opening the browser.
Was this helpful to you?
Quote

Question owner

TyDraniu said

I can't really reproduce the issue. It's always "read ABC" after opening the browser.

not exactly. please try this way - open the browser the first line is the current value. press to monitor the second line changes to display the new value. ((ideally, when the first line and the second line are different) remember in mind the value of the second line. close the browser. open the browser and see that the first line had new meaning. I have old.

''TyDraniu [[#answer-1235664|said]]'' <blockquote> I can't really reproduce the issue. It's always "read ABC" after opening the browser. </blockquote> not exactly. please try this way - open the browser the first line is the current value. press to monitor the second line changes to display the new value. ((ideally, when the first line and the second line are different) remember in mind the value of the second line. close the browser. open the browser and see that the first line had new meaning. I have old.
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8633 solutions 70605 answers

Hi vipmaster-05, how are you closing your Firefox for Android:

close the browser.

(I use the Restore Tabs setting, so I don't think I can test this problem.)

Hi vipmaster-05, how are you closing your Firefox for Android: <blockquote> close the browser. </blockquote> (I use the Restore Tabs setting, so I don't think I can test this problem.)
Was this helpful to you?
Quote

Question owner

jscher2000 said

Hi vipmaster-05, how are you closing your Firefox for Android:
close the browser.

(I use the Restore Tabs setting, so I don't think I can test this problem.)

good idea. I close my so - click the square button (the button at the bottom right of the phone monitor) then click on the basket (on the bottom centre of the monitor). this should free up memory.

''jscher2000 [[#answer-1235674|said]]'' <blockquote> Hi vipmaster-05, how are you closing your Firefox for Android: <blockquote> close the browser. </blockquote> (I use the Restore Tabs setting, so I don't think I can test this problem.) </blockquote> good idea. I close my so - click the square button (the button at the bottom right of the phone monitor) then click on the basket (on the bottom centre of the monitor). this should free up memory.
Was this helpful to you?
Quote

Question owner

can I make a video for You?

can I make a video for You?
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8633 solutions 70605 answers

Maybe a video would be good.

It sounds as though you are using the Android system-level feature -- recent applications? -- to unload Firefox, and not the built-in Quit command (the Quit command is linked with clearing at least one kind of data).

Maybe a video would be good. It sounds as though you are using the Android system-level feature -- recent applications? -- to unload Firefox, and not the built-in Quit command (the Quit command is linked with clearing at least one kind of data).
Was this helpful to you?
Quote

Question owner

made when opening seen in the first row of null - values no. press fit into in the store "ABC" then read from it and eventually see the second line ABC. reopen the browser in the first line reads the value from the store and it is not ABC.

https://fex.net/s/otb6lyl (there are 2 identical files. it just happened. if you need video can do any more and send you like.)

made when opening seen in the first row of null - values no. press fit into in the store "ABC" then read from it and eventually see the second line ABC. reopen the browser in the first line reads the value from the store and it is not ABC. https://fex.net/s/otb6lyl (there are 2 identical files. it just happened. if you need video can do any more and send you like.)
Was this helpful to you?
Quote

Question owner

tell me please, did You manage to reproduce the problem? video downloaded?

tell me please, did You manage to reproduce the problem? video downloaded?
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8633 solutions 70605 answers

Thank you for the video, I understand what you are seeing. I am not losing the saved value, but as I mentioned, my Firefox for Android is set to restore tabs, which could affect how data is retained.

Thank you for the video, I understand what you are seeing. I am not losing the saved value, but as I mentioned, my Firefox for Android is set to restore tabs, which could affect how data is retained.
Was this helpful to you?
Quote

Question owner

jscher2000 said

Thank you for the video, I understand what you are seeing. I am not losing the saved value, but as I mentioned, my Firefox for Android is set to restore tabs, which could affect how data is retained.

that is, the solution to this problem, I can't wait(?

''jscher2000 [[#answer-1235900|said]]'' <blockquote> Thank you for the video, I understand what you are seeing. I am not losing the saved value, but as I mentioned, my Firefox for Android is set to restore tabs, which could affect how data is retained. </blockquote> that is, the solution to this problem, I can't wait(?
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8633 solutions 70605 answers

You could try it and see whether it makes any difference on your device:

menu button > Settings > Advanced > Restore tabs > Always restore

You could try it and see whether it makes any difference on your device: menu button > Settings > Advanced > Restore tabs > Always restore
Was this helpful to you?
Quote

Question owner

I'm developing. I can use any browser from 15. but the customers I will not explain how and what to use. technology must work flawlessly and equally.

this problem is only in two browsers and appeared recently after some update.

where else can I write to resolve this issue?

I'm developing. I can use any browser from 15. but the customers I will not explain how and what to use. technology must work flawlessly and equally. this problem is only in two browsers and appeared recently after some update. where else can I write to resolve this issue?
Was this helpful to you?
Quote

Question owner

jscher2000 said

You could try it and see whether it makes any difference on your device: menu button > Settings > Advanced > Restore tabs > Always restore

I Supplement my message above. looked now. I have, too, is the restoration of tabs.

''jscher2000 [[#answer-1235903|said]]'' <blockquote> You could try it and see whether it makes any difference on your device: menu button > Settings > Advanced > Restore tabs > Always restore </blockquote> I Supplement my message above. looked now. I have, too, is the restoration of tabs.
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8633 solutions 70605 answers

There must be some other difference between your Firefox for Android and the two volunteers testing in this thread. I can't think of what would cause it.

Is the problem only with your app or does it affect other pages that use local storage? Example: https://mdn.github.io/dom-examples/web-storage/

There must be some other difference between your Firefox for Android and the two volunteers testing in this thread. I can't think of what would cause it. Is the problem only with your app or does it affect other pages that use local storage? Example: https://mdn.github.io/dom-examples/web-storage/
Was this helpful to you?
Quote

Question owner

jscher2000 said

There must be some other difference between your Firefox for Android and the two volunteers testing in this thread. I can't think of what would cause it. Is the problem only with your app or does it affect other pages that use local storage? Example: https://mdn.github.io/dom-examples/web-storage/

Thanks. a good example for tests. But it doesn't work either. There is a Fox - choose a turtle - rediscovering and there again, Fox. I can make a video, too. (I specifically checked this example on the PC, everything is correct.)

previously, I worked fine (both in Opera and FireFox), I wrote a lot of JavaScript and tested everything.

''jscher2000 [[#answer-1235915|said]]'' <blockquote> There must be some other difference between your Firefox for Android and the two volunteers testing in this thread. I can't think of what would cause it. Is the problem only with your app or does it affect other pages that use local storage? Example: https://mdn.github.io/dom-examples/web-storage/ </blockquote> Thanks. a good example for tests. But it doesn't work either. There is a Fox - choose a turtle - rediscovering and there again, Fox. I can make a video, too. (I specifically checked this example on the PC, everything is correct.) previously, I worked fine (both in Opera and FireFox), I wrote a lot of JavaScript and tested everything.
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8633 solutions 70605 answers

Is the local storage value only lost when you swipe off the app? In other words, is it preserved if you close that page and open it in a different tab without swiping off Firefox?

Is the local storage value only lost when you swipe off the app? In other words, is it preserved if you close that page and open it in a different tab without swiping off Firefox?
Was this helpful to you?
Quote

Question owner

jscher2000 said

Is the local storage value only lost when you swipe off the app? In other words, is it preserved if you close that page and open it in a different tab without swiping off Firefox?

Yes, there is a pattern. 1) if you close the tab but do not close the browser. That values are always saved. 2) if you do not close the tab and close the browser, the values are not saved. (I will tell you, in opere exactly such laws).

''jscher2000 [[#answer-1235921|said]]'' <blockquote> Is the local storage value only lost when you swipe off the app? In other words, is it preserved if you close that page and open it in a different tab without swiping off Firefox? </blockquote> Yes, there is a pattern. 1) if you close the tab but do not close the browser. That values are always saved. 2) if you do not close the tab and close the browser, the values are not saved. (I will tell you, in opere exactly such laws).
Was this helpful to you?
Quote
Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.