Open Bug 1895215 Opened 2 months ago Updated 25 days ago

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

Categories

(DevTools :: Storage Inspector, task, P2)

task

Tracking

(Not tracked)

People

(Reporter: timhuang, Assigned: nchevobbe)

References

(Blocks 2 open bugs)

Details

Attachments

(1 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)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: