Closed Bug 1895215 Opened 1 year ago Closed 1 year ago

Add a new field in Cookies to display partitionKey for CHIPS cookies

Categories

(DevTools :: Storage Inspector, task, P2)

task

Tracking

(firefox135 fixed)

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: timhuang, Assigned: nchevobbe)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file, 1 obsolete file)

We have introduced a new cookie attribution called partitioned in the CHIPS implementation. This allows website developers to explicitly request the cookie to be stored in the partitioned cookie jar. For a better development experience, we would like to add a new field under the cookies panel in the storage inspector. This field will display the partitionKey used for the cookie.

Ideally, we should allow developers to change the partition key using this field. However, this can lead to confusing corner cases, like how to deal with a situation where the changed cookie conflicts with an existing cookie after the change or how to handle the case where the partitionKey gets changed to an irrelevant site, i.e., not the top-level or third-party domain. Therefore, we should make this field unchangeable unless we have sorted out all possible corner cases.

Blocks: 1672148
Whiteboard: [devtools-triage]

Let's add a new read-only column for the partitioned property.
We should decide if the column will be visible by default.
We should also add it in the sidepanel, in the "Data" section.

Priority: -- → P2

Tim, quick question is the "partitioned" property already available for us to check on cookies, or do we need any extra platform API?

Flags: needinfo?(tihuang)
Whiteboard: [devtools-triage]

The partitionKey can be acquired via the originAttributes field of nsICookie interface. The field partitionKey of OriginAttributes is the value.

Flags: needinfo?(tihuang)
Assignee: nobody → nchevobbe

I think that this is behind the network.cookie.cookieBehavior.optInPartitioning pref.
It looks like Bug 1886133 is changing some things around this pref, so I'll wait a bit before finishing my patch and writing tests.

Tim, just to be sure, in order for the partition key to be created, you need both network.cookie.cookieBehavior.optInPartitioning and network.cookie.CHIPS.enabled set to true right?

At least, from my testing, if I don't have CHIPS enabled, I'm not seeing a partitionKey in the cookie.

Flags: needinfo?(tihuang)
Attachment #9401400 - Attachment description: WIP: Bug 1895215 - [devtools] Display cookie's partitionKey in storage panel. r=#devtools-reviewers → Bug 1895215 - [devtools] Display cookie's partitionKey in storage panel. r=#devtools-reviewers!,timhuang!

If you are talking about the first-party context, yes, we need to enable network.cookie.CHIPS.enabled for partition key to appear on first-party cookies. We don't need to enable this pref for the partition key to show up on the cross-site iframe. Maybe you can test it as well. And I don't think we need to enable network.cookie.cookieBehavior.optInPartitioning.

Flags: needinfo?(tihuang)
Depends on: 1907570

Comment on attachment 9401400 [details]
Bug 1895215 - [devtools] Display cookie's partitionKey in storage panel. r=#devtools-reviewers!,timhuang!

Revision D210169 was moved to bug 1907570. Setting attachment 9401400 [details] to obsolete.

Attachment #9401400 - Attachment is obsolete: true

The following patch is waiting for review from an inactive reviewer:

ID Title Author Reviewer Status
D216397 Bug 1895215 - [devtools] Display cookie's partitionKey in storage panel. r=#devtools-reviewers!,timhuang! nchevobbe timhuang: Back Aug 4, 2024

:nchevobbe, could you please find another reviewer?

For more information, please visit BugBot documentation.

Flags: needinfo?(nchevobbe)

(In reply to BugBot [:suhaib / :marco/ :calixte] from comment #10)

The following patch is waiting for review from an inactive reviewer:

ID Title Author Reviewer Status
D216397 Bug 1895215 - [devtools] Display cookie's partitionKey in storage panel. r=#devtools-reviewers!,timhuang! nchevobbe timhuang: Back Aug 4, 2024

:nchevobbe, could you please find another reviewer?

For more information, please visit BugBot documentation.

this can wait until Tim is back

Flags: needinfo?(nchevobbe)
See Also: → 1925171

What is the status of this bug? With the recent chips-related breakage it would be very helpful if we had visibility/modifiability of partitioned cookies.

Flags: needinfo?(nchevobbe)

(In reply to edgul from comment #12)

What is the status of this bug? With the recent chips-related breakage it would be very helpful if we had visibility/modifiability of partitioned cookies.

I was off for a couple weeks and prior to that I had other, more urgent things to work on. I'll try to resume my work on the patches and push this over the finish line soon

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a551f98b192c [devtools] Display cookie's partitionKey in storage panel. r=timhuang,devtools-reviewers,ochameau
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: