Created
September 14, 2013 20:54
-
-
Save 4poc/6565551 to your computer and use it in GitHub Desktop.
mechanize moneypatch: extend cookie_jar to allow to import/export cookies as strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mechanize::CookieJar | |
public | |
def save_str | |
s = StringIO.new | |
save(s, :cookiestxt, :session => true) | |
s.string | |
end | |
def load_str(str) | |
s = StringIO.new str | |
load(s, :cookiestxt, :session => true) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment