Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Anti-forgery cookie errors. What's the cause? #158

@TFAstudio

Description

@TFAstudio

We've been using Formulate for many years but started getting occasional server errors after we upgraded a couple of customers to a new version (for Umbraco v7) back in September 2019. These are all single-server hosting environments (no load-balancing etc).

The errors are reported from a range of mobile phones including iPhone (OS 10.3.2, 11.4.1, 12.3.1, 12.4 etc), and Android 8 & 9 (mainly Samsung but also Pixel 2 & Pixel 3). Almost no desktop environments are seemingly affected (only a few errors from Windows NT 10.0). Reported IP addresses all correlate to Australian mobile service companies (and the occasional ISP) and look like legitimate local traffic.

Most common error is:
_System.Web.Mvc.HttpAntiForgeryException (0x80004005): The required anti-forgery cookie "_RequestVerificationToken" is not present.

But we also get these occasionally:
System.Web.Mvc.HttpAntiForgeryException (0x80004005): The anti-forgery token could not be decrypted. If this application is hosted by a Web Farm or cluster, ensure that all machines are running the same version of ASP.NET Web Pages and that the configuration specifies explicit encryption and validation keys. AutoGenerate cannot be used in a cluster.

They happen a few times per week and we haven't been able to replicate the behaviour. We normally get a string of errors from the same IP address, indicating that a frustrated user is trying to resubmit a form repeatedly.

I've tried to research what could be causing these errors but had little luck. Perhaps IIS & hosting related? Any ideas will be gratefully welcomed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions