class Rack::Test::Cookie

def matches?(uri)

Cookies that do not match the URI will not be sent in requests to the URI.
def matches?(uri)
  !expired? && valid?(uri) && uri.path.start_with?(path)
end