Bug 151408 - Web Inspector: Storage tab shouldn't hide cookies for .example.com when inspected page is foo.bar.example.com
Summary: Web Inspector: Storage tab shouldn't hide cookies for .example.com when inspe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: DoNotImportToRadar
Depends on: 151424
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-18 14:26 PST by BJ Burg
Modified: 2015-11-18 22:30 PST (History)
7 users (show)

See Also:


Attachments
Proposed Fix (12.84 KB, patch)
2015-11-18 17:58 PST, BJ Burg
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2015-11-18 14:26:02 PST
The regular expression we use to match resource domains to cookie domains only allows for one subdomain, apparently:

    static cookieDomainMatchesResourceDomain(cookieDomain, resourceDomain)
    {
        if (cookieDomain.charAt(0) !== ".")
            return resourceDomain === cookieDomain;
        return !!resourceDomain.match(new RegExp("^([^\\.]+\\.)?" + cookieDomain.substring(1).escapeForRegExp() + "$"), "i");
    }

See <rdar://problem/23041415>.
Comment 1 BJ Burg 2015-11-18 14:29:29 PST
To test this, we should move the logic into a model class static method. Come to think of it, this code is stupidly structured and blocks live updates by making the view responsible for fetching cookies. But let's take this a step at a time...
Comment 2 BJ Burg 2015-11-18 17:58:44 PST
Created attachment 265817 [details]
Proposed Fix

This patch won't apply, as it depends on the other patch that moves the code.
Comment 3 BJ Burg 2015-11-18 22:30:42 PST
Committed r192615: <http://trac.webkit.org/changeset/192615>