Uses for MachineKey in ASP.NET

BenMaddox picture BenMaddox · Feb 15, 2009 · Viewed 16.4k times · Source

What different ways are Machine Keys useful in asp.net? I think the following are correct but thought there may be more.

  1. Multiple applications can use the same cookie
  2. Multiple servers can work with the same viewstate

Answer

Sergiu Damian picture Sergiu Damian · Feb 15, 2009

MachineKey is used for:

  • ViewState encryption and validation
  • Forms Authentication (or Federated Authentication) uses this key for signing the authentication ticket

Having a Web App installed on multiple servers requires same Machine Key configured on all of them in order for Load Balancing to work.

To see all details, please refer to: MSDN How To: Configure MachineKey in ASP.NET 2.0