int hostLength = PL_strlen(host);
cookie_IsInDomain(char* domain, char* host, int hostLength) {  int domainLength = PL_strlen(domain);  /* special case for domainName being identical to hostName   *   This probably buys some efficiency.   *   But, more important, it allows a site that has an IP address to set a domain   *      cookie for that same domain.  This should be illegal (domain cookies for   *      IP addresses make no sense) and will be trapped by the very next test.  However   *      that test was actually preventing hotmail attachments from working.  See bug   *      105917 for details.  So we will allow IP-address sites to set domain cookies in   *      this one special case -- where the domain name is identically equal to the host   *      name.   */  if (!PL_strcmp(domain, host)) {    return PR_TRUE;  }  /*   * test for domain name being an IP address (e.g., 105.217.180.21) and reject if so   */  if (cookie_IsIPAddress(domain)) {    return PR_FALSE;  }  /*   * special case for domainName = .hostName   *    e.g., hostName = netscape.com   *          domainName = .netscape.com   */  if ((domainLength == hostLength+1) && (domain[0] == '.') &&       !PL_strncasecmp(&domain[1], host, hostLength)) {    return PR_TRUE;  }  /*   * normal case for hostName = x<domainName>   *    e.g., hostName = home.netscape.com   *          domainName = .netscape.com   */  if(domainLength <= hostLength &&      !PL_strncasecmp(domain, &host[hostLength-domainLength], domainLength)) {    return PR_TRUE;  }  /* tests failed, not in domain */  return PR_FALSE;}