SaaS CMS has officially launched! Learn more now.

500 Error on Episerver form submit.



We are encountering 500 error when submitting Episerver forms occasionally.

The exact 500 error is anti-forgery token is missing.

We have confirmed that the form submission is allowed for anonymous user.

Relative Package version:

Episerver.Contentdeliveryapi.forms  v 2.6.1

Episerver.form V 4.25

Some details to note:

Our content site is powered by react, thus we followed the guide on

We are able to render the form successfully using data provided by content delivery api and javascript.

After some debugging, I noticed that the content delivery api is returning a set cookie header for __requestVerficationtoken.

Occasionally the value of the cookie is missing, and this is causing 500 error on form submit.

If we get a correct response from content delivery API, we are able to submit the form without any error.

Does anyone ran into this problem before? And is there any workaround on this ?

Apr 14, 2020 16:55

Hi Wen, Have you used any type caching on the page like [ContentOutputCache] attributes on the page where this form is rendering? If yes then removed the caching from the page and then try because when the page gets reload then the cookie is not refreshing and throwing 500 errors.

Edited, Apr 15, 2020 5:29

I am experiencing a very similar error.  Was there any further developement on this Wen?  Just hoping for some glimmer of light into this issue.  My forms are also not showing the error on the page, causeing users to think the submission was successful when it was not.

Nov 04, 2021 13:49

Hey, Royk,

I vaguely remember that we had to get the form data from content delivery api 2 times to get it working. Its kinda wacky, but it works.

so like  api.getData().finally(api.getData().then(FormRenderingService.default.render(, node)));


Nov 04, 2021 14:00
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.