Bug 238257 - Session storage items were automatically cleared after manually changing the URL (only reproducible when the dev tool panel is not opened)
Summary: Session storage items were automatically cleared after manually changing the ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Website Storage (show other bugs)
Version: Safari 15
Hardware: All macOS 12
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-23 06:32 PDT by Dmytro
Modified: 2022-08-09 22:11 PDT (History)
5 users (show)

See Also:


Attachments
example of the issue (16.31 MB, video/quicktime)
2022-03-23 06:32 PDT, Dmytro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmytro 2022-03-23 06:32:18 PDT
Created attachment 455492 [details]
example of the issue

Preconditions: 
Do not open the developer tool panel.

Steps to reproduce:
1) Try to add a key-value item to the session storage on your resource.
2) Change URL path to another route, or just CTRL+C - CTRL+V current one.
3) Check out the created session storage item. It's not present anymore.

It's curious, that the browser does not clear the items if the dev tool is open, but only without a panel.
Comment 1 Alexey Proskuryakov 2022-03-23 09:48:16 PDT
Presumably this is about when Safari and WebKit decide to swap underlying processes, which is not too surprising to be different when Web Inspector is open.

On one hand, it's not great to have different behaviors when Web Inspector is open and when it isn't. But on another hand, preserving SessionStorage seems to make sense in a debugging workflow, where people reload a lot.
Comment 2 Radar WebKit Bug Importer 2022-03-24 16:07:52 PDT
<rdar://problem/90799623>
Comment 3 Dan 2022-08-09 22:11:27 PDT
I just ran into this issue as well.
It can also be reproduced with the example created by Florian Schoppmann for bug #199928 

With developer tools closed:
- Go to https://fschopp.github.io/safari-local-storage-bug/
- Click the link in step 1 (this now works correctly)
- Command + l to enter the location bar
- Click enter to request the same URL again
- sessionStorage has now been deleted and the example fails again