New issue
Advanced search Search tips

Issue 856777 link

Starred by 5 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature

Blocked on:
issue 801910
issue 875849



Sign in to add a comment

Improve logging / visibility of blocked cookies

Project Member Reported by mmenke@chromium.org, Jun 26 2018

Issue description

We're getting a fair number of cookie-related bug reports like issue 696204, where it's really unclear what's going on.  We have multiple paths for blocking cookies, some in the network delegate, some in the CookieStore.

I think we should try to address this by improving visibility of what cookies we refuse to set in two ways:

1)  Logging information about blocked cookies, on both paths, to devtools.
2)  Logging information about blocked cookies, on both paths, to NetLog.

The former would make what's going on much more visible to consumers / web developers, and the latter would help Chrome network stack developers debug these issues.
 

Comment 1 by mmenke@chromium.org, Jun 26 2018

[morlovich]:  Maks, not sure what your priorities are here, and there's the question of how this would work with the network service, but think better logging of just what's going on, particularly through devtools, would result in a lot fewer cookie bug reports, or at least ones that are a lot easier to diagnose.  Doesn't help with database loading issues, but think the majority of cookie bugs aren't related to that.

Comment 2 by mmenke@chromium.org, Jun 26 2018

Labels: -Type-Bug Type-Feature
Open to reviewing something on the devtools side, not quite having enough resources to ask someone to do it though. Any takers on net/ side?
Labels: Network-Triaged
Status: Available (was: Untriaged)
Cc: csharrison@chromium.org mmenke@chromium.org
Cc: jeffej@chromium.org
Blockedon: 801910
Blockedon: 875849
I've started poking at this.

One way to handle this would be to have some sort of general error/warning enum (Not just for cookies) that takes some parameters, like:

NET_WARNING_COOKIE_NOT_SEND_BECAUSE_OF_STRICT_SECURE_ORIGIN / [name, value, origin, initiator], and then have that converted to a string, either in devtools, or in the network service / network stack.  We generally don't produce text errors in either of those, so it's a little weird to do it in this case, though the potentially variable number of arguments can also be pretty ugly.  We could name them all instead of a list, though the size of data passed to devtools was raised as an issue on another CL.

devtools folks:  Any thoughts?  I'd like to introduce a general API that we could add other (hopefully rare) per-request events in unusual situations that could be display on devtools, when inspecting network requests.  Maybe a new warnings section there?  Not sure.  The only things I'm thinking of adding currently are when we don't send a cookie (For 3 or 4 different reasons), and when we refuse to set a cookie (One or two reasons, I believe).

Of course, these particular events may make the most sense on the cookies tab, so it might be worth doing something cookies-specific for these particular cases, and I could populate the domain/path/expires fields and the like for request cookies while I'm at it.  Could add other sections for cookies that weren't sent / weren't set, and add a reason field or something.
Owner: mmenke@chromium.org
Status: Assigned (was: Available)
Owner: aarontag@chromium.org
Project Member

Comment 12 by bugdroid1@chromium.org, Jan 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/480ce3a628d3e7ee594d42fc25fab1bd8e976489

commit 480ce3a628d3e7ee594d42fc25fab1bd8e976489
Author: Aaron Tagliaboschi <aarontag@chromium.org>
Date: Mon Jan 14 20:06:01 2019

Changed IncludeForRequestURL in CanonicalCookie to return enum of inclusion status instead of boolean.

(including relevant unit tests and uses of the function)

Bug: 856777

Change-Id: Iab7de0438a1a661de663a146d46d12d4034c6628
Reviewed-on: https://chromium-review.googlesource.com/c/1405546
Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622562}
[modify] https://crrev.com/480ce3a628d3e7ee594d42fc25fab1bd8e976489/content/browser/cookie_store/cookie_change_subscription.cc
[modify] https://crrev.com/480ce3a628d3e7ee594d42fc25fab1bd8e976489/ios/web/net/cookies/wk_http_system_cookie_store.mm
[modify] https://crrev.com/480ce3a628d3e7ee594d42fc25fab1bd8e976489/net/cookies/canonical_cookie.cc
[modify] https://crrev.com/480ce3a628d3e7ee594d42fc25fab1bd8e976489/net/cookies/canonical_cookie.h
[modify] https://crrev.com/480ce3a628d3e7ee594d42fc25fab1bd8e976489/net/cookies/canonical_cookie_unittest.cc
[modify] https://crrev.com/480ce3a628d3e7ee594d42fc25fab1bd8e976489/net/cookies/cookie_deletion_info.cc
[modify] https://crrev.com/480ce3a628d3e7ee594d42fc25fab1bd8e976489/net/cookies/cookie_monster.cc
[modify] https://crrev.com/480ce3a628d3e7ee594d42fc25fab1bd8e976489/net/cookies/cookie_monster_change_dispatcher.cc
[modify] https://crrev.com/480ce3a628d3e7ee594d42fc25fab1bd8e976489/services/network/restricted_cookie_manager.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Jan 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9e1de1b67f4c2f98c095138effdd36098105c4bd

commit 9e1de1b67f4c2f98c095138effdd36098105c4bd
Author: Aaron Tagliaboschi <aarontag@chromium.org>
Date: Tue Jan 15 14:40:06 2019

Decouple filtering when creating list of cookies.

Small change, but super helpful later down the line
when we need the full list of cookies (including ones have been
filtered)

Bug: 856777
Change-Id: I1934f1f086929b74522b5e0283a812abcda87b1e
Reviewed-on: https://chromium-review.googlesource.com/c/1409909
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622847}
[modify] https://crrev.com/9e1de1b67f4c2f98c095138effdd36098105c4bd/net/cookies/cookie_monster.cc

Sign in to add a comment