title: Recaptcha ambethia - Input error: k: Format of site key was invalid / invalid-request-cookie
body: <p>The error in the title is visible only in firebug.  Everything from where I put the recaptcha element on down, is not shown on the page, though is present in the page-source (Mozilla and Opera) - though no error is shown in firebug.</p>
  
  <p>So far, based on others solutions, I have tried reversing the keys (public and private, though they are clearly identified), generating a global-key-pair and using those, and even hard-coding the values into the recaptcha.rb initializer file versus using system-vars.  No luck in any cases in dev or production. Also tried suppressing the 'noscript' part, with no change.</p>
  
  <p>The Gem-Generated Page Source reads:</p>
  
  <pre><code>    &lt;script type="text/javascript" src="//www.google.com/recaptcha/api/challenge?k=[" mypublickeyhere", "myprivatekeyhere", false]&amp;amp;lang="&gt;&lt;/script&gt;
      &lt;noscript&gt;
        &lt;iframe src="//www.google.com/recaptcha/api/noscript?k=["mypublickeyhere", "myprivatekeyhere", false]" height="300" width="500" style="border:none;"&gt;&lt;/iframe&gt;&lt;br/&gt;
        &lt;textarea name="recaptcha_challenge_field" rows="3" cols="40"&gt;&lt;/textarea&gt;
        &lt;input type="hidden" name="recaptcha_response_field" value="manual_challenge"/&gt;&lt;/noscript&gt;
  </code></pre>
  
  <p>Why is my private key visible in the page-source?  All that code comes from putting this in my view: </p>
  
  <pre><code>    &lt;%= recaptcha_tags %&gt;
  </code></pre>
  
  <hr>
  
  <p>Edit:  Made some progress, many hours in, by force-feeding the keys in the form and controller with:</p>
  
  <pre><code>    &lt;%= recaptcha_tags :public_key =&gt; 'mypublickeyhere' %&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    if ( verify_recaptcha :private_key =&gt; 'myprivatekeyhere' )
  </code></pre>
  
  <p>Which gets the recaptcha to show up on the form, and keeps my private-key from being spammed to the page-code by the plugin as it does in 'default' mode.</p>
  
  <p>Unfortunately, even if captcha is entered correctly, we get a NEW Error, "invalid-request-cookie".  </p>
  
  <p>Is there a single example of using this plugin in Rails 3, with full working form and controller code?  </p>
  
  <hr>
  
  <p>More Info for other sufferers:</p>
  
  <p>Google Says this error means: "The challenge parameter of the verify script was incorrect."</p>
  
  <p>On another page, if you search for "challenge parameter," to find out whatever that is, Google says: "recaptcha_challenge_field is a hidden field that describes the CAPTCHA which the user is solving. It corresponds to the 'challenge' parameter required by the reCAPTCHA verification API."</p>
  
  <p>So why is the plugin not providing the correct challenge parameter as it should?  Perhaps I need to pass something somewhere - but what and where?  Again, a simple example would be great.  </p>