且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C#Asp.net MVC的身份,用户注销很快

更新时间:2023-02-25 17:52:09

原因用户注销是因为在表单的身份验证数据和视图状态数据的验证错误。它可能发生不同的原因,其中包括举办services.You应检查&LT使用Web场;将machineKey> 项目中的 webconfig 。检查这里,了解有关细节。如果你没有<的machineKey> webconfig ,尝试添加这块code后<&的System.Web GT; 在webconfig:

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"
    />

在使用中产生的另一种选择内部webconfig ASP.NET计算机密钥。还有我推荐的是并的这个