首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ABP曲奇到期时间问题

ABP曲奇到期时间问题
EN

Stack Overflow用户
提问于 2018-05-06 11:22:33
回答 1查看 1.4K关注 0票数 1

我用的是ABP v3.3.0。在这个版本中,我有了一些新的经验。我的应用程序要求每30分钟登录一次,因为我的SignIn方法需要30分钟的过期时间:

代码语言:javascript
复制
_authenticationManager.SignIn(
    new AuthenticationProperties
    {
        IsPersistent = true,
        ExpiresUtc = DateTimeOffset.UtcNow.AddMinutes(int.Parse(System.Configuration.ConfigurationManager.AppSettings["AuthSession.ExpireTimeInMinutes.WhenNotPersistent"] ?? "30"))
    },
    identity);

在我的Startup类中,我找到了以下代码:

代码语言:javascript
复制
// 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属性。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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时,取消选中继续运行后台应用程序。

是的,这是个拼写错误。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50199115

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档