We're using Amazon EC2 Elastic Beanstalk on an ASP.NET MVC 4 site and are getting an error after the user tries to login:
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.
We thought the issue might be due to the session state being in proc and having dynamic instances so we moved that to SQL Server but are still getting the error. What's weird is that sometimes the login is fine and sometimes you get the error.
Is there something special that needs to be done to handle this issue for ASP.NET MVC in a dynamic web server environment like EC2?