class Patron::Session
def handle_cookies(file = nil)
If file is nil they will be stored in memory. Otherwise the +file+
Makes this session handle cookies and store them in in +file+.
def handle_cookies(file = nil) if file path = Pathname(file).expand_path unless File.exists?(file) and File.writable?(path.dirname) raise ArgumentError, "Can't create file #{path} (permission error)" end unless File.readable?(file) or File.writable?(path) raise ArgumentError, "Cant read or write file #{path} (permission error)" end end enable_cookie_session(path.to_s) self end