CaptchaBundle icon indicating copy to clipboard operation
CaptchaBundle copied to clipboard

Session is null after submiting a form

Open atuzon opened this issue 11 years ago • 4 comments

Hi Gregwar.

I put the captcha in a form and all goes well. The problem is when I do the submit of that form I saw that in the captchaValidator $expectedCode = $this->getExpectedCode(); is always null. I noticed that the session in this class is started but is empty.

Thanks for your time. Kind Regards

atuzon avatar Oct 03 '14 15:10 atuzon

Hello, Can you check that the value is stored in the session here: https://github.com/Gregwar/CaptchaBundle/blob/master/Type/CaptchaType.php#L119 What are your settings?

Gregwar avatar Oct 03 '14 20:10 Gregwar

The symfony version is 2.1. The value is correctly stored and I can see the next phrase that is going to be shown in the captcha. All is correct in that point, the problem is when I submit the form. My session settings are: session: cookie_lifetime: 360000
cookie_domain: "%base_domain%" handler_id: ~

Thanks for your time.

atuzon avatar Oct 06 '14 08:10 atuzon

I forgot to tell that I''m using memchache but the route of this form is excluded from caching.

atuzon avatar Oct 06 '14 08:10 atuzon

I don't know how to help you with this. Does your sessions works for other purpose? Does manually accessing the session allow you to get the values stored from the captcha system later?

Gregwar avatar Oct 09 '14 07:10 Gregwar