Bug 174153

Summary: Web Inspector: Incorrect storage details for partitioned hosts (cookies)
Product: WebKit Reporter: Mike West <mkwst>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bburg, inspector-bugzilla-changes, joepeck, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Mike West 2017-07-05 00:57:27 PDT
It appears that there's a disconnect between the cookies sent out with a given request, and the cookies displayed in the "Storage" pane of the Web Inspector for that request's host. In particular, it seems to be the case that when storage is partitioned, the "Storage" pane displays the cookies associated with that host in the top level. The same seems to apply to things like `localStorage`, which also don't seem to be showing partitioned values.

It would be helpful if there was a mechanism to inspect the cookie jar associated with a given partition for a given host.
Comment 1 Radar WebKit Bug Importer 2017-07-05 10:04:14 PDT
<rdar://problem/33136349>
Comment 2 Joseph Pecoraro 2018-01-09 14:42:26 PST
Yep, this is a pretty ugly case.

We'd be showing cookies that aren't actually the cookies applying to requests.
Comment 3 Joseph Pecoraro 2018-01-09 15:22:35 PST
Some notes after talking with johnwilander:

Cookie partitioning can happen per-frame and can change dynamically throughout the lifetime of the frame.

Some examples of dynamically changing:

  (a) Default iframe cookies are not partitioned
  (b) Tracker classified frames are partitions
    - User Interaction in a frame can dynamically change that frame's cookies to be not partitioned
  (c) New Storage Access APIs
    - If user allowed can dynamically change that frame's cookies to be not partitioned

There may also be the case that a time period expires and cookies go back to being partitioned.

The fact that this is per-frame raises a few interesting points for Web Inspector. There may be an A.com page with multiple B.com subframes, and one of the B.com subframes can be dynamically promoted to not partitioned. In this case Web Inspector would want to show both the (B) non-partitioned cookies and the (A/B) partitioned cookies.