class Rack::Test::CookieJar

def each_cookie_for(uri)

we'll have grabbed the most specific to the URI.
so that when we are done, the cookies will be unique by name and
the cookie can be sent to the current URI. It's added to the hash
all the cookies in order and add it to a hash by cookie name if
The cookies are sorted by most specific first. So, we loop through

Yield each cookie that matches for the URI.
def each_cookie_for(uri)
  @cookies.each do |cookie|
    yield cookie if !uri || cookie.matches?(uri)
  end
end