MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / RecurseCookieDomain

Method RecurseCookieDomain

cpp/iedriver/CookieManager.cpp:265–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265bool CookieManager::RecurseCookieDomain(const std::string& url,
266 const BrowserCookie& cookie) {
267 int status = this->SetCookie(url, cookie);
268
269 size_t dot_index = cookie.domain().find_first_of('.');
270 if (dot_index == 0) {
271 BrowserCookie first_dot_cookie = cookie.Copy();
272 first_dot_cookie.set_domain(cookie.domain().substr(1));
273 return this->RecurseCookieDomain(url, first_dot_cookie);
274 } else if (dot_index != std::string::npos) {
275 BrowserCookie no_dot_cookie = cookie.Copy();
276 no_dot_cookie.set_domain(cookie.domain().substr(dot_index));
277 return this->RecurseCookieDomain(url, no_dot_cookie);
278 }
279
280 BrowserCookie no_domain_cookie = cookie.Copy();
281 no_domain_cookie.set_domain("");
282 status = this->SetCookie(url, no_domain_cookie);
283 return status == WD_SUCCESS;
284}
285
286std::string CookieManager::ReadCookieFile(const std::wstring& file_name) {
287 LOG(TRACE) << "Entering CookieManager::ReadCookieFile";

Callers 1

RecurseCookiePathMethod · 0.95

Calls 4

SetCookieMethod · 0.95
set_domainMethod · 0.80
domainMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected