E
E
Evgeny Lavrentiev2014-07-06 19:01:52
Yii
Evgeny Lavrentiev, 2014-07-06 19:01:52

Yii2 Captcha validation error, how to fix?

Comrades, I ask for help, I put it on the Captcha form, everything seems to be fine, but if you click on the picture, the Captcha text changes but the form refuses to accept the new code, and the old first code is all right.
Can you suggest where I'm wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Borisovich, 2014-07-07
@Alexufo

change the captcha code, update the session. And then you check the new code with the previous session.

A
Alexander Pantyukhov, 2016-03-24
@Paromon

I have a similar problem. I am using standard yii2 captcha. The captcha field is in ActiveForm. Everything is fine in the session, but the rules for the captcha field do not match the check in the session, i.e.:
before updating the image
field rule: ertert
session parameter: ertert
after updating the image
field rule: ertert
session parameter: werwer
as a result, if you enter the parameter that matches with the field rule, the page will be updated, but as if there was an input error, and if you enter a parameter that matches the session parameter, the button is not pressed due to the fact that the field rule does not match. Gentlemen, what are your suggestions? :shock:

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question