Users log out very quickly

前端 未结 1 593
我寻月下人不归
我寻月下人不归 2020-12-01 17:17

I am using ASP.NET identity membership. This is the Startup.Auth.cs code:

 app.CreatePerOwinContext(EFDbContext.Create);
        app.CreatePerOwinContext<         


        
相关标签:
1条回答
  • 2020-12-01 17:56

    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.

    0 讨论(0)
提交回复
热议问题