Asp.net 生成新machinekey会中断现有用户的登录

Asp.net 生成新machinekey会中断现有用户的登录,asp.net,authentication,cookies,Asp.net,Authentication,Cookies,我们有一个应用程序,我们想改变机器的关键。此密钥用于对ASP.NET中的会话、cookie(以及其他)进行加密 更改计算机密钥时,我们希望ASP.NET使所有现有cookie无效,并在尝试访问受身份验证保护的页面时显示登录页面。但是,我们最终会遇到以下例外情况: [加密异常:加密操作期间出错。] System.Web.Security.Cryptography.同质化CryptoServiceWrapper.同质化错误(Func`2 Func,Byte[]输入)+178 System.Ident

我们有一个应用程序,我们想改变机器的关键。此密钥用于对ASP.NET中的会话、cookie(以及其他)进行加密

更改计算机密钥时,我们希望ASP.NET使所有现有cookie无效,并在尝试访问受身份验证保护的页面时显示登录页面。但是,我们最终会遇到以下例外情况:

[加密异常:加密操作期间出错。]
System.Web.Security.Cryptography.同质化CryptoServiceWrapper.同质化错误(Func`2 Func,Byte[]输入)+178
System.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(字节[]cookie,布尔出站)+179
System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(XmlReader阅读器,SecurityTokenResolver tokenResolver)+827
System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(字节[]token,SecurityTokenResolver tokenResolver)+87
System.IdentityModel.Services.SessionAuthenticationModule.ReadSessionTokenFromCookie(字节[]SessionOkie)+569
System.IdentityModel.Services.SessionAuthenticationModule.TryReadSessionTokenFromCookie(SessionSecurityToken和sessionToken)+306
System.IdentityModel.Services.SessionAuthenticationModule.OnAuthenticationateRequest(对象发送方,EventArgs EventArgs)+159
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+229
System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成)+98

(我为这里的格式错误道歉。)

这意味着通过更改机器密钥会中断现有的登录用户,这并不是我们想要的。我们也可以清除比现在旧的cookies,但这听起来很难做到

有没有办法解决这个问题而不显式地使用户的cookie无效,比如purposed in或in