[Webkit-unassigned] [Bug 199928] sessionStorage/localStorage lose data (if followed by window.location.href = ...)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 19 14:30:49 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=199928

--- Comment #2 from Florian Schoppmann <mail at florian-schoppmann.net> ---
It appears that the WebKit bug occurs if sessionStorage or localStorage are accessed “too early.” In that case, they appear disconnected (for both reads and writes) from the persistent storage, for the entire time the user stays on the current page.

A workaround is for the JavaScript code to wait before accessing the storage. I updated my test case at https://fschopp.github.io/safari-local-storage-bug/ so it demos both the bug (as before) and the workaround.

Interestingly, it appears Firefox used to have a similar problem.
https://stackoverflow.com/questions/13852209/localstorage-unreliable-in-firefox/13856156
(The workaround mentioned on StackOverflow -- accessing sessionStorage.length -- does not work for Safari, though.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190719/451ef7de/attachment.html>


More information about the webkit-unassigned mailing list