title: Facebook login via Perl WWW::Mechanize, login error "Cookies Required"
body: <p>I have a Perl script that I run in Strawberry Perl in which I login to Facebook using WWW::Mechanize. For a short background, I use my script to automate an occasional "leaderboard" for a fun little game I invented to be played among my group of friends. I assign points based upon certain posts, and the objective is to earn the most points. Very simple. This script is complete, and it's worked for me in the past (I last ran it 4 days ago). However, I am unable to login to Facebook today. I dumped the content after the form submission to an HTML file, and it appears that I've returned back to the login screen with a red error box:</p>
  
  <blockquote>
    <p>Cookies Required</p>
    
    <blockquote>
      <p>Cookies are not enabled on your browser. Please enable cookies in your browser preferences to continue.</p>
    </blockquote>
  </blockquote>
  
  <p>From what I understand, WWW::Mechanize features automatic cookies -- in other words by the default constructor, the bot should be accepting cookies. Cookies should be enabled by the browser. I should not see this screen, right?</p>
  
  <p>I've read and experimented with WWW:Mechanize and HTTP::Cookies, but no matter what I try (fooling around with the cookie jar every which way), I cannot get past this "cookies required" error.</p>
  
  <p>This is my code without any experimental fluff, very simple.</p>
  
  <pre><code>use WWW::Mechanize;
  
  my $mech = WWW::Mechanize-&gt;new();
  $mech-&gt;get("https://www.facebook.com/login.php");
  $mech-&gt;submit_form(
      fields =&gt; {
          email =&gt; '&lt;my email here&gt;',
          pass =&gt; '&lt;my password here&gt;',
      }
  );
  
  open($out, "&gt;",  "output_page.html") or die "Can't open output_page.html: $!";
  print $out $mech-&gt;content;
  </code></pre>