New issue
Advanced search Search tips

Issue 756553 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug
Team-Security-UX



Sign in to add a comment

Cookie count is +2 of what it should be

Project Member Reported by est...@chromium.org, Aug 17 2017

Issue description

Chrome Version: 62.0.3188.0
OS: OSX

What steps will reproduce the problem?
(1) Visit www.google.com in a fresh profile.
(2) Open Page Info, and observe the "in use" count under Cookies.
(3) Click the "in use" link to open the cookie viewer and count the number of cookies in the cookie viewer.

What is the expected result?
The number of cookies listed in the cookie viewer matches the number in "in use" in Page Info.

What happens instead?
Page Info shows "n+2 in use" where n is the number of cookies in the cookie viewer. (see screenshot; Page Info says "3 in use" but I only see 1)

Please use labels and text to provide additional information.


For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
Screen Shot 2017-08-17 at 12.15.30 PM.png
348 KB View Download

Comment 1 by est...@chromium.org, Sep 22 2017

Summary: Cookie count is +2 of what it should be (was: Cookie count is +2 of what it should bec)

Comment 2 by est...@chromium.org, Sep 22 2017

Cc: carlosil@chromium.org
Carlos: this might be a good one to look at if you run out of things to do. :) https://cs.chromium.org/chromium/src/chrome/browser/ui/page_info/page_info.cc?type=cs&l=845 looks like where we get the cookie count -- from glancing at the code, I'm guessing it might be counting localStorage items as cookies... maybe?
Cc: -carlosil@chromium.org
Owner: carlosil@chromium.org
Status: Started (was: Available)
Will start working on this one. Quick testing on other sites seems to confirm it is counting localStorage items (so it is not always n+2). E.g. chromium-review.googlesource.com results in "5 in use", with 4 cookies and 1 local storage item. 
Cc: est...@chromium.org
Looks like the problem comes from local_shared_objects_container.cc, while its method GetObjectCountForDomain returns the count of the cookies for the domain ( so, no third party), despite the similar name (that would seem to indicate the only difference is it includes third party) the method GetObjectCount returns the count of all objects (so storage, cookies, etc.) for all domains (third party included).
What I'm thinking of doing is:
-Rename GetObjectCountForDomain to GetCookieCountForDomain to make the difference in behavior more obvious.
-Create a GetCookieCount method that includes cookies for all domains (third party included).
-Use those in page_info to generate the count.

 
Nevermind, looks like GetObjectCountForDomain also counts all objects, not only cookies, so it would not be a rename, but also creating a separate GetCookieCount that only counts cookies. Now I'm a bit confused, because those two methods are (as far as I can see) only ever called from the page info to set that (cookie) counter.

Comment 6 by est...@chromium.org, Nov 10 2017

Labels: Hotlist-EnamelAndFriendsFixIt

Comment 7 by est...@chromium.org, Feb 18 2018

Labels: -Hotlist-EnamelAndFriendsFixIt
Labels: Hotlist-DesktopUICheckedHotlist-DesktopUIChecked Hotlist-DesktopUIValid
**Mass UI Triage**

This issue is still reproduced on Mac OS 10.13.3 from M60 to latest canary-72.0.3617.0.Could some one from dev please take a look.

Thanks..!!

Sign in to add a comment