New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 703485 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Cookie sort in Network panel does not always keep selected cookie selected

Reported by ja...@apphaus.co.uk, Mar 21 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36

Steps to reproduce the problem:
1. Open the network panel and record activity
2. Visit a URL which triggers request which will have two cookies with the same name, domain and path in the request or response (https://www.microsoft.com/en-gb/ does in the response on the second load of the page) 
3. Click on the request with the cookies in the network panel, and click the 'cookies' tab
4. When sorting by various cookie properties in the table, note that the selected cookie can swap between the two cookies from step 2

What is the expected behavior?
1. That when a cookie in the table is selected, it continues to be selected when the table is sorted

What went wrong?
1. The two cookies with identical names, domains and paths are not correctly distinguished.
2. Consequently, when sorting the table the selected cookie can swap between the two cookies from (1) when sorting.

Did this work before? N/A 

Chrome version: 57.0.2987.110  Channel: stable
OS Version: OS X 10.12.3
Flash Version: Shockwave Flash 25.0 r0

This is only an issue in the Network panel, as the Cookie pane within the Application panel reflects stored cookies which (as per the spec) will not store multiple cookies if they (simplified) share the same name, domain and path.

I will try to put together a reduced test case and example screencap.

It may not be possible to verify this bug in recent canary builds due to  Issue 702940 
 
Labels: Needs-Triage-M57
Owner: allada@chromium.org

Comment 3 by ja...@apphaus.co.uk, Mar 21 2017

I have a reduced test-case;

1. Open devtools and record activity in the network panel
2. Visit https://crbug-703485.glitch.me/
3. Click on the request for crbug-703485.glitch.me and click on the cookies tab
4. Note two response cookies - select the first by clicking on it
5. Use the difference in the size column to differentiate the otherwise identical cookies
6. Sort by the size column multiple times - note that the selected cookie moves from the first response cookie to the second (and last), and despite the cookies being re-ordered by the sort the last cookie is always selected

Expected outcome;
1. As the originally selected cookie is selected, it should remain selected whilst its position changes in the table

I would be happy to provide a CL for this, if it's agreed that action should be taken. _isSameCookie in third_party/WebKit/Source/devtools/front_end/cookie_table only compares the cookie name, domain and path at present.

 
crbug-703485.webm
866 KB View Download
Labels: M-59 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Windows-10, Ubuntu 14.04 and Mac OS 10.12 using chrome latest stable #57.0.2987.110 by following steps mentioned in the comment #3.
Observed the selected cookies doesn't remain selected by sorting the cookies.

This issue is observed in older version of chrome M35-35.0.1849.0 as well. Hence marking it as untriaged.

Comment 5 by allada@chromium.org, Apr 18 2017

Status: WontFix (was: Untriaged)
TL;DR
It's better to not do anything than to have a high chance of breaking things.



So, I created a patch that should have resolved this issue (https://codereview.chromium.org/2823103002/), but we decided not to proceed with it.

The problem comes down to the cookies being exactly the same, so the DataGrid does not have a key to uniquely identify the entry to restore the selection. DataGrid is an area we do not like modifying because it's a growing problem area and every time we touch it, it breaks things and often ends up making it even worse. We have plans on eventually rewriting our DataGrid component, but it's not easy and we have lots of edge cases.

In looking into this bug, I did discover that the reason this was even visible to the user was because we show two inconsistent sizes for the exact same cookie data. This was because of a few things...

Headers can contain a single Set-Cookie header with multiple cookies being set or multiple Set-Cookie headers setting multiple cookies. To handle this easier, we split the cookies up then concat them back together with "\n". This then gives us an easy string to parse, however in reality there will always be an extra "\n" to terminate the header entry.

This then causes the parser to consider the last cookie to not have any terminating character and one cookie will always be -1 byte than the rest.

The question then becomes:
Do we consider "\n" characters to be a part of the cookie or header or both?
Which cookie do we consider the ";" to be a part of (right or left [if exists])?

We ended up deciding not to do anything about this right now because we are afraid we will break things. Part of this data is accessible via chrome's extensions. If we change this logic to be what we think is "correct", then extensions might break.

We are going to mark this as WontFix because of this, but when DataGrid gets fixed it'll at least fix this particular issue.

Sign in to add a comment