Bug 196872 - WebDriver: Set Cookie endpoint does not correctly set subdomain cookies
Summary: WebDriver: Set Cookie endpoint does not correctly set subdomain cookies
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-12 11:27 PDT by Devin Rousso
Modified: 2019-04-15 12:49 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.13 KB, patch)
2019-04-12 11:30 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.