我用的是ABP v3.3.0。在这个版本中,我有了一些新的经验。我的应用程序要求每30分钟登录一次,因为我的SignIn方法需要30分钟的过期时间:
_authenticationManager.SignIn(
new AuthenticationProperties
{
IsPersistent = true,
ExpiresUtc = DateTimeOffset.UtcNow.AddMinutes(int.Parse(System.Configuration.ConfigurationManager.AppSettings["AuthSession.ExpireTimeInMinutes.WhenNotPersistent"] ?? "30"))
},
identity);在我的Startup类中,我找到了以下代码:
// by setting following values, the auth cookie will expire after the
// configured amount of time (default 14 days) when user set the
// (IsPermanent == true) on the login
ExpireTimeSpan = new TimeSpan(int.Parse(ConfigurationManager.AppSettings["AuthSession.ExpireTimeInDays.WhenPersistent"] ?? "14"), 0, 0, 0),但是在AccountController中,没有名为IsPermanent的属性。AuthenticationProperties是一个具有名为IsPersistent的属性的对象。
我想这是个拼写错误。如果没有,请帮助我在登录时找到IsPermanent属性。
发布于 2018-05-06 13:30:07
ABP采用Microsoft.AspNetCore.Http.Authentication's AuthenticationManager.SignInAsync方法和AuthenticationProperties.IsPersistent属性。
它适用于登录页面上的“记住我”复选框。
请参阅这一解释
持久性cookie将保存为浏览器文件夹中的文件,直到它们过期或手动删除为止。即使关闭浏览器,这也会导致cookie持久化。 如果IsPersistent设置为false,则浏览器将获取会话cookie,当浏览器关闭时将清除该会话cookie。 现在,会话cookie在重新启动浏览器后不能清除的原因是铬默认设置。要修复它,请使用->高级的chrome设置,并在系统部分关闭Google时,取消选中继续运行后台应用程序。
是的,这是个拼写错误。
https://stackoverflow.com/questions/50199115
复制相似问题