Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Storage gets deleted on iOS and iPadOS after Browser Restart #3182

Open
fl-ing opened this issue Jul 5, 2024 · 3 comments
Open

Local Storage gets deleted on iOS and iPadOS after Browser Restart #3182

fl-ing opened this issue Jul 5, 2024 · 3 comments
Labels

Comments

@fl-ing
Copy link

fl-ing commented Jul 5, 2024

p5.js version

v1.9.5 // Web Editor: v2.13.4

What is your operating system?

iOS, iPadOS

Web browser and version

Chrome: 126.0.6478.54; Firefox 127.1 (42781); iPadOS 17.5.1

Actual Behavior

While using the p5.js web editor: When saving something in local storage using the storeItem([key], value) function, the local storage gets deleted on iOS and iPadOS after closing the browser. The type of browser does not matter. I've tried on Chrome, Firefox and Safari.

It should not be a problem with my privacy settings, because lokal storage on other Websites (like https://mdn.github.io/dom-examples/web-storage/ ) works fine, even after restarting the browser.

It also appears not to be a problem with my code, because the same code works fine on different browsers on Windows, Android AND macOS.

Expected Behavior

I would expect no different behaviour of persistent local storage on iOS and iPadOS.

Steps to reproduce

  1. access via p5.js web editor on iOS or iPadOS on any browser: https://editor.p5js.org/fl-ing/sketches/G-4fSKqjH
  2. run it and tap a few times to store the score in local storage
  3. restart the browser and run the scetch again

Probable Cause of the issue

After some research, I suspect that the issue arises due to the scetch being contained in an <iframe> Tag (preview.p5js.org) and the local storage object being stored in the browser under that subdomain. The local storage beeing cleared after a browser reset is likely a WebKit security measure to prevent third party tracking ("Intelligent Tracking Prevention" https://webkit.org/blog/7675/intelligent-tracking-prevention/). One solution could be to store and access the local storage object under the domain editor.p5js.org. But this exceeds the scope of my understanding.

@fl-ing fl-ing added the Bug label Jul 5, 2024
Copy link

welcome bot commented Jul 5, 2024

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

@fl-ing fl-ing changed the title Local Storage gets deleted on iOS and iPadOS after Browser Reset Local Storage gets deleted on iOS and iPadOS after Browser Restart Jul 7, 2024
@andrewkmin
Copy link

andrewkmin commented Sep 17, 2024

Hi @fl-ing just curious — did you ever reach a response or resolution on this?

@fl-ing
Copy link
Author

fl-ing commented Sep 17, 2024

Hi @andrewkmin , unfortunately not. You are the first who replied. I am fairly new to programming, so solving this problem extends the scope of my abilities right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants