Safari - iOS cookie handling doesn't find any secure cookies
See original GitHub issueThe problem
To reset the browser to a clean state in my tests, I often use the deleteAllCookies()
method to clear the test’s state. With Appium and iOS, cookie handling appears to be limited to non secure cookies for the same domain. Even checking the number of cookies after calling deleteAllCookies()
seems to leave several cookies on sites secured with HTTPS.
Running the same test with Appium and Android deletes all the cookies for the domain as expected.
Environment
- Appium version (or git revision) that exhibits the issue: 1.53
- Desktop OS/version used to run Appium: Mac OS X 10.11.6
- Mobile platform/version under test: iOS 9.3
- Real device or emulator/simulator: Both
- Appium CLI or Appium.app|exe: Appium.app
Code To Reproduce Issue
Step through in debug mode - subsititue your own account details!
driver.get("https://accounts.google.com/AccountChooser");
driver.findElement(By.cssSelector("#Email")).sendKeys("youraccount@gmail.com");
driver.findElement(By.cssSelector("input#next")).click();
driver.findElement(By.cssSelector("#Passwd")).sendKeys("password");
driver.findElement(By.cssSelector("input#signIn")).click();
int clear = 0;
int secure = 0;
Set<Cookie> cookies = driver.manage().getCookies();
for (Cookie cookie : cookies) {
if(cookie.isSecure()) {
secure++;
} else {
clear++;
}
}
System.out.println("Found " + secure + " secure cookies");
System.out.println("Found " + clear + " clear cookies");
driver.manage().deleteAllCookies();
driver.navigate().refresh();
Set<Cookie> cookies1 = driver.manage().getCookies();
System.out.println(cookies1.size() + " still found.";
Appium Logs
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
iOS11: Cookies intermittently bloc… | Apple Developer Forums
In iOS 11, cookies are not shared between Safari and each web apps, but it seems a web app sometimes uses cookies that...
Read more >Safari not sending cookie even after setting SameSite=None
Safari is no longer sending cross-site cookies. So even if the cookie is set to SameSite=None it will not be sent with the...
Read more >Enable Cookies in Safari on iPhone - WhatIsMyBrowser.com
Most websites need cookies enabled to work properly, so check out our guide to configuring cookies and permissions on Safari on iPhone.
Read more >Enable Cookies on iPhone: Safari, Chrome, and Firefox
In the Privacy & Security section, make sure Block All Cookies is toggled off. You will know it is off when the slider...
Read more >How to enable cookies - Rocky Mountain Power
HOW TO ENABLE COOKIES. Google Chrome. Safari iOS (iPhone and iPad) ... Step 3: Under “Privacy and security”, click “Site Settings”. Step 4:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the repro @hazmeister we’ll look into it.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.