# File lib/domain_name.rb, line 133
  def cookie_domain?(domain, host_only = false)
    # RFC 6265 #5.3
    # When the user agent "receives a cookie":
    return self == domain if host_only

    domain = DomainName.new(domain) unless DomainName === domain
    if ipaddr?
      # RFC 6265 #5.1.3
      # Do not perform subdomain matching against IP addresses.
      @hostname == domain.hostname
    else
      # RFC 6265 #4.1.1
      # Domain-value must be a subdomain.
      @domain && self <= domain && domain <= @domain ? true : false
    end
  end