Bug 196872

Summary: WebDriver: Set Cookie endpoint does not correctly set subdomain cookies
Product: WebKit Reporter: Devin Rousso <hi>
Component: WebDriverAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, hi, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Devin Rousso 2019-04-12 11:27:58 PDT
```py
from selenium import webdriver

driver = webdriver.Safari(executable_path='$build/Release/safaridriver')

driver.get("https://apple.com")
driver.add_cookie({
    'name': 'testfromotherdomain',
    'value': '42',
    'domain': 'school.apple.com',
})

driver.get("https://school.apple.com")
driver.add_cookie({
    'name': 'testfromsamedomain',
    'value': '42',
    'domain': 'school.apple.com',
})
```

After running the above, stop the active session and inspect <https://school.apple.com>.  There should be two cookies ("testfromotherdomain" and "testfromsamedomain"), but there's only one ("testfromsamedomain").
Comment 1 Devin Rousso 2019-04-12 11:28:20 PDT
<rdar://problem/49233240>
Comment 2 Devin Rousso 2019-04-12 11:30:51 PDT
Created attachment 367336 [details]
Patch
Comment 3 Joseph Pecoraro 2019-04-15 12:21:02 PDT
Comment on attachment 367336 [details]
Patch

r=me
Comment 4 WebKit Commit Bot 2019-04-15 12:49:13 PDT
Comment on attachment 367336 [details]
Patch

Clearing flags on attachment: 367336

Committed r244281: <https://trac.webkit.org/changeset/244281>
Comment 5 WebKit Commit Bot 2019-04-15 12:49:15 PDT
All reviewed patches have been landed.  Closing bug.