10

In my magento site I have enabled Captcha for Create Account form of custom theme which I built from scratch(not "rwd"), but when I try to register a customer with providing correct captcha code in the field, even then it shows "Incorrect Captcha" after refreshing & redirecting to same page.

No warnings/errors either in the client or server.

Can anyone guide me ?

2
  • 1
    I'm having the same issue. I noticed though if you click the refresh button on the CAPTCHA image and enter the new value correctly, it accepts it. Have you experienced the same behaviour?
    – Moose
    Commented Jun 13, 2015 at 8:51
  • Try free one magecomp.com/magento-new-recaptcha.html Commented May 15, 2018 at 19:17

4 Answers 4

2

You can solved by Debug the captcha check process.

So ,please follow the below process.

Magento customer registration form's captcha has been check at class Mage_Captcha_Model_Observer on function checkUserCreate() using controller_action_predispatch_customer_account_createpost event.

There magento is check captcha value at using :

$captchaModel->isCorrect($this->_getCaptchaString(Mage::app()->getRequest(), $formId))

That means here magento send the value of field of captcha[user_create] and the field is match on Mage_Captcha_Model_Zend at function isCorrent()

This field match with session value.

Mage::getSingleton('customer/session')->getData($this->_getFormIdKey('word')

value

By using this you can track where the issue

1
  • iam also getting same error.how to check this @Amit Bera
    – User0434
    Commented May 26, 2017 at 6:35
1

The problem can refer to incorrect input field name (for example, name="captcha_user_create" instead of name="captcha[user_create]"). Or JS captcha init new Captcha(...) is fired twice.

Is there file template/captcha/zend.phtml in your custom theme?

Do you use captcha on other pages (forgot-password, login)? Does it work correctly on another pages?

Do you use two captchas on single page?

Also please make sure that you don't call Mage_Captcha_Model_Zend::isCorrect method twice, as it wipes out captcha value from customer session. If you do, you will always get that "Incorrect CAPTCHA" message.

1
  • Now that you mention it, there are two captchas on the single page. We have a pop-up login icon and I see a CAPTCHA is being generated there as well when on the registration page. The only place CAPTCHA is enabled is on the customer registration page.
    – Moose
    Commented Jun 15, 2015 at 15:31
1

View your source and see if there is another CAPTCHA form on the page.

I had this same issue. The problem for me was that the AjaxPro extension had a hidden login form that was also using CAPTCHA. Since both forms had the same block name of "captcha", my block was being used twice, and the code was being refreshed for the second (hidden) form on page load, thus invalidating the one on my form. So I had to rename the block for my custom form, for example, from "captcha" to "captcha.custom". Then it worked great.

1
  • I can confirm that this was the root of my issue. I too had the AjaxPro extension and it added a login popover box in the header. When I hovered over, i saw the second CAPTCHA. I fixed it by going to app/design/frontend/base/default/template/tm/ajaxpro/customer/login.phtml and commenting this out: <?php echo $this->getChildHtml('form.additional.info'); ?>.
    – NotJay
    Commented Jul 27, 2018 at 16:06
0

One reason for this, other than the ones already mentioned, can be having an incorrectly referenced resource trying to load from a JS request on the same request URL, which for few Magento pages causes the regeneration of the captcha in session, without refreshing the frontend shown captcha image, as the output will go to that ajax request.

For example, I was having a JS lightbox trying to load an image referencing a relative path, which was causing an additional request to /customer/account/forgotpassword with the following request path: /customer/account/forgotpassword/images/black.png, this causing the captcha code to change in session.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.