Coder Social home page Coder Social logo

invalid-request-cookie about recaptcha HOT 5 CLOSED

ambethia avatar ambethia commented on July 26, 2024
invalid-request-cookie

from recaptcha.

Comments (5)

ambethia avatar ambethia commented on July 26, 2024

Can you tell me more about your setup?

from recaptcha.

chaserx avatar chaserx commented on July 26, 2024

Yeah. Thanks. How much info is helpful?

Development ENV
Mac OS X (10.5); Safari, Chrome; Ruby 1.8.7p72; Rails 2.3.5; Mongrel 1.1.5; reCaptcha plugin 0.2.3

Tried reCaptcha keys for localhost and mymacbookpro.local

from recaptcha.

chaserx avatar chaserx commented on July 26, 2024

invalid-request-cookie shows as flash error

registration_controller.rb:
def create
@registration = Registration.new(params[:registration])
if verify_recaptcha(:private_key => PASSWORDS_CONFIG[:recaptcha_private_key]) and @registration.save
flash[:notice] = "Successfully created registration."
redirect_to @registration
else
render :action => 'new'
end
end

views / _form.html.erb:
<%= recaptcha_tags :public_key => PASSWORDS_CONFIG[:recaptcha_public_key] %>

from recaptcha.

ambethia avatar ambethia commented on July 26, 2024

And you recaptcha key pair was definitely created specifically for localhost?

from recaptcha.

chaserx avatar chaserx commented on July 26, 2024

Yeah. Well... I assumed that would work fine as a registered key pair for myrailsapp.com gives the same error. Reading the reCaptcha documentation suggests that any valid key pair should work, however, as localhost is not enforced. (see below).

Anyway, I created keys for: myrailsapp.com, localhost, 127.0.01, mymacbookpro.local
Same error for each pair of keys. Perhaps there's something funky about recaptcha and localhost, or maybe it's just me.

If you have a suggestion on where to get more debug information, please let me know. Sorry to clog up your issue queue.

From the reCaptcha docs:
Key scope:
If one of your servers is "localhost" or "127.0.0.1", reCAPTCHA will not enforce the same-domain rule. Just use the same key as for the production server.

Errors:
invalid-request-cookie
-> The challenge parameter of the verify script was incorrect.

from recaptcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.