class Rack::Test::Cookie

def valid?(uri)

Whether the cookie is valid for the given URI.
def valid?(uri)
  uri ||= default_uri
  uri.host = @default_host if uri.host.nil?
  !!((!secure? || (secure? && uri.scheme == 'https')) &&
    uri.host =~ Regexp.new("#{'^' if @exact_domain_match}#{Regexp.escape(domain)}$", Regexp::IGNORECASE))
end