Sitecore Forms: Object moved to here

Hi Folks,

We were working on an upgrade project from Sitecore 9.0.1 to 10.3. After the upgrade, we verified the upgraded website, while testing the page that has Sitecore Form we noticed that when we filled in the information and clicked on submit button, it gave an “object moved to here” error pop-up. When we published the form and issue did not appear for the first time but after the first time when we tried to fill the form again and clicked the form submit button, we got the above-mentioned error again. And we were using the “Redirect to Page” OOTB submit action. We decided to dig into this issue.

After spending some time we noticed that it was related to parent rendering caching that has a placeholder to hold the form.

This is how we set the form –

Form rendering with parent rendering –

Caching on parent rendering –

Solution – So after removing caching from Parent rendering, this object moved to here error is resolved.

Reason – So what caused the issue, we can find below –

Sitecore Forms utilizes the ‘__RequestVerificationToken’ for security purposes. As you may know, the ‘__RequestVerificationToken’ in ASP.NET is a mechanism designed to prevent possible CSRF attacks. It’s crucial to note that caching the ‘__RequestVerificationToken’ can lead to undesired behavior, as outlined in the article: https://stackoverflow.com/questions/17805103/asp-net-mvc-antiforgerytoken-and-caching. 

When the rendering containing the Sitecore Forms item is marked for caching, it includes caching the value of the ‘__RequestVerificationToken’. Thereafter, during subsequent form operations, the outdated ‘__RequestVerificationToken’ value may be used. This leads to the behavior we have faced.

Therefore, the renderings that are used for the Sitecore Forms should not be marked as Cacheable. Additionally, keep in mind that caching options are nested, so if the parent rendering is marked as cacheable, caching is also applied to child renderings. 

Hope this helps.

Happy Sitecoring 🙂

Leave a comment