TransWikia.com

CSRF error with Contact Form and a new domain name

Craft CMS Asked by userAW on April 23, 2021

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.]

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP