lib/tagen/watir.rb
def dump_cookies(file)
      io = case file
      when String
        open(file, "w")
      else
        file
      end

      cookies.to_a.each do |cookie|
        io.puts([
          cookie[:domain],
          "FALSE", # for_domain
          cookie[:path],
          cookie[:secure] ? "TRUE" : "FALSE",
          cookie[:expires].to_i.to_s,
          cookie[:name],
          cookie[:value]
        ].join("\t"))
      end

      io.close if String === file

      self
    end
def dump_cookies(file)
      io = case file
      when String
        open(file, "w")
      else
        file
      end

      cookies.to_a.each do |cookie|
        io.puts([
          cookie[:domain],
          "FALSE", # for_domain
          cookie[:path],
          cookie[:secure] ? "TRUE" : "FALSE",
          cookie[:expires].to_i.to_s,
          cookie[:name],
          cookie[:value]
        ].join("\t"))
      end

      io.close if String === file

      self
    end
Write cookies to Mozilla cookies.txt-style IO stream

 @param file [IO,String]