Browse files

Add header line when writing to cookies.txt

When Python is reading a Netscape-format cookies.txt file, it seems to
require an initial line that looks like this:

    # Netscape HTTP Cookie File
  • Loading branch information...
1 parent b7cdf96 commit f851b526da51315b3e5f789d51c796c2ff974da0 @mmorearty mmorearty committed with Mike Morearty Feb 18, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/mechanize/cookie_jar.rb
@@ -187,6 +187,7 @@ def load_cookiestxt(io)
# Write cookies to Mozilla cookies.txt-style IO stream
def dump_cookiestxt(io)
+ io.puts "# Netscape HTTP Cookie File"
to_a.each do |cookie|

0 comments on commit f851b52

Please sign in to comment.