I have an iframe coming from different subdomain on my Razor page. When I post the form within the iframe, I see "400 Bad Request" error on the browser console. This error happens in the staging environment. However, I do not get this error on my local machine.
These are the things I tried but did not fix the problem:
• I checked the CORS settings and made sure that both clients give necessary permissions to each other.
• I also checked CSP settings. I included the project that contains the iframe element in the "frame-ancestors" directive.
• Finally, I came across a comment suggesting that this error could be caused by blocking third-party cookies in the browser while performing the form post. Despite disabling the option to block third-party cookies in the browser settings, the problem was not resolved.
How can I solve this problem?