We are using Pixel & Tonic's Contact Form plugin. It was working fine. We just assigned a new domain name to the Craft subsite whose template uses the Contact Form. The form has stopped working. We believe this is due to CSRF token/cookie since we get a “Bad Request. Unable to verify your data submission” error when we try to submit the Contact Form.

Any ideas how we might fix this? I can’t find many resources on Craft and CSRF other than clearing browser cache/cookies (which did not solve the problem) and making sure to include the CSRF input field, which we have. I try to compare CSRF token value and cookies but they don’t look similar at all.

[We tested in dev by disabling the general.php ‘enableCSRFProtection’ flag. When we did this, the Contact Form submitted and sent us the email as expected. Strangely, the flash message did not show. Since we don’t want to set that flag to false in prod, not sure where to go from here.]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.