def should_send?(request_uri, script)
      uri = CookieJar::CookieValidation.to_uri request_uri
      # cookie path must start with the uri, it must not be a secure cookie
      # being sent over http, and it must not be a http_only cookie sent to
      # a script
      path = if uri.path == ''
               '/'
             else
               uri.path
      end
      path_match   = path.start_with? @path
      secure_match = !(@secure && uri.scheme == 'http')
      script_match = !(script && @http_only)
      expiry_match = !expired?
      ports_match = ports.nil? || (ports.include? uri.port)
      path_match && secure_match && script_match && expiry_match && ports_match
    end
def should_send?(request_uri, script)
      uri = CookieJar::CookieValidation.to_uri request_uri
      # cookie path must start with the uri, it must not be a secure cookie
      # being sent over http, and it must not be a http_only cookie sent to
      # a script
      path = if uri.path == ''
               '/'
             else
               uri.path
      end
      path_match   = path.start_with? @path
      secure_match = !(@secure && uri.scheme == 'http')
      script_match = !(script && @http_only)
      expiry_match = !expired?
      ports_match = ports.nil? || (ports.include? uri.port)
      path_match && secure_match && script_match && expiry_match && ports_match
    end
Determine if a cookie should be sent given a request URI along with
 other options.

 This currently ignores domain.

 @param uri [String, URI] the requested page which may need to receive
 this cookie
 @param script [Boolean] indicates that cookies with the 'httponly'
 extension should be ignored
 @return [Boolean] whether this cookie should be sent to the server