How to use the tough-cookie.pathMatch function in tough-cookie

To help you get started, we’ve selected a few tough-cookie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bertrandom / chrome-cookies-secure / index.js View on Github external
cookies.forEach(function (cookie) {

					if (cookie.is_secure && !isSecure) {
						return;
					}

					if (!tough.domainMatch(host, cookie.host_key, true)) {
						return;
					}

					if (!tough.pathMatch(path, cookie.path)) {
						return;
					}

					validCookies.push(cookie);

				});
github assaf / zombie / src / cookies.js View on Github external
      cookies = cookies.filter(cookie => Tough.pathMatch(identifier.path, cookie.path));
    if (identifier.domain)
github cypress-io / cypress / packages / server / lib / browsers / cdp_automation.ts View on Github external
const cookieMatches = (cookie: CyCookie, data) => {
  if (data.domain && !tough.domainMatch(cookie.domain, data.domain)) {
    return false
  }

  if (data.path && !tough.pathMatch(cookie.path, data.path)) {
    return false
  }

  if (data.name && data.name !== cookie.name) {
    return false
  }

  return true
}