From: Patrick Hurley Date: 2006-05-13T03:46:32+09:00 Subject: Mechanize and Cookies I am trying to access some google stuff (summer of code :-) which requires that I am signed in - when I run the code below it says "Your browser's cookie functionality is turned off. Please turn it on" Mechanize seems to support cookies, but I must be doing something wrong. Thanks pth -------------------------------------------------- require 'mechanize' agent = WWW::Mechanize.new {|a| a.log = Logger.new(STDERR) } page = agent.get('http://www.google.com/') link = page.links.text(/sign\s*in/i).first page = agent.click(link) form = page.forms[0] email = form.fields.find { |f| f.name =~ /email/i } email.value = 'email addr' passwd = form.fields.find { |f| f.name =~ /passwd/i } passwd.value = 'pass word' submit = form.buttons.find { |b| b.value =~ /sign\s*in/i } page = agent.submit(form, submit) puts page.body