def to_s(ver = 0, prefix = true)
      return "#{name}=#{value}" if ver == 0

      # we do not need to encode path; the only characters required to be
      # quoted must be escaped in URI
      str = prefix ? "$Version=#{version};" : ''
      str << "#{name}=#{value};$Path=\"#{path}\""
      str << ";$Domain=#{domain}" if domain.start_with? '.'
      str << ";$Port=\"#{ports.join ','}\"" if ports
      str
    end
def to_s(ver = 0, prefix = true)
      return "#{name}=#{value}" if ver == 0

      # we do not need to encode path; the only characters required to be
      # quoted must be escaped in URI
      str = prefix ? "$Version=#{version};" : ''
      str << "#{name}=#{value};$Path=\"#{path}\""
      str << ";$Domain=#{domain}" if domain.start_with? '.'
      str << ";$Port=\"#{ports.join ','}\"" if ports
      str
    end
Returns cookie in a format appropriate to send to a server.

 @param [FixNum] 0 version, 0 for Netscape-style cookies, 1 for
   RFC2965-style.
 @param [Boolean] true prefix, for RFC2965, whether to prefix with
 "$Version=<version>;". Ignored for Netscape-style cookies