A
A
Alexander Pantyukhov2016-03-23 13:21:19
Yii
Alexander Pantyukhov, 2016-03-23 13:21:19

Question on YII2. When you click on the captcha image, it changes, but the text, even if it is correct, writes that it is incorrect. What could be the problem?

The captcha itself is done as follows:
$form->field($model, 'captcha')->widget(\yii\captcha\Captcha::classname(), [
'captchaAction' => 'authorization/captcha', ]
)
captcha is in ActiveForm.
I can not figure out where the problem is and what. When refreshing the page, the captcha is not updated, but you can enter the same as before refreshing the page and you will get the correct input. Maybe someone faced such a problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vyachin, 2016-06-13
@vyachin

change session store from default to database or store sessions in cache
'session' => [
'class' => 'yii\web\DbSession',
// 'db' => 'mydb',
// 'sessionTable' => 'my_session',
]
or so
'session' => [
'class' => 'yii\web\CacheSession',
// 'cache' => 'mycache',
]

C
cepblu, 2016-07-06
@cepblu

Came here specifically to say that this doesn't work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question