Closed maartenheideman closed 4 years ago
When set enableCsrfProtection
to false, submissions works from al domains works. But set enableCsrfProtection
to false is not desirable, in my opinion?
You are correct we don't want to turn off csrf, I will test it with a multisite setup whenever I have some downtime
I just tested this on a local setup using a multisite, and it's working correctly. Are you sure it's the multisite setup and not some type of caching plugin? I say this because that's very common, caching an old token and then invalidating the request. Disable any caching plugin you might have install and test the form on all domains without it. Let me know what you find.
In the general config I’ll set ‘enableTemplateCaching’ to true. Could that be the problem?
turn it off and see if it works without caching. just troubleshoot until we find the cause of the problems. Then we can solve it.
enableCsrfProtection
was not the problem. Turns out the problem was the defaultCookieDomain
I'll set up because of the live preview is the problem As suggested here: https://craftcms.com/knowledge-base/using-live-preview-across-multiple-subdomains. As soon as I'll remove that line it works.
In a mulisite environment with multiple domains I'll get an error 'HTTP 400 – Bad Request' when try to send a form. Unable to verify your data submission. On the primary site it works like a charm on the others I'll get the error. What could this be?
this are my htaccess settings:
I'll work with an form include like this:
include file: