Open Jacobvu84 opened 3 years ago
Check Cookie
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.");