Users log out very quickly

The reason for users logging off is because of error in validation of forms-authentication data and view-state data. It could happen for different reasons including using web farm in hosting services.You should check <machineKey> in your project webconfig. Check here for details about that. If you don’t have<machineKey>in your webconfig, try adding this piece of code after <system.web> in your webconfig:

    <machineKey 
    validationKey="AutoGenerate,IsolateApps"
    decryptionKey="AutoGenerate,IsolateApps"
    validation="HMACSHA256"
    decryption="Auto"
    />

The other option is using generated ASP.NET Machine Key inside webconfig. There are some online tools which my recommended ones are this and this.

Leave a Comment