发布时间:2020-02-25 20:08:18来源:本站阅读(825)
上酸菜
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(o =>
{
o.LoginPath=new PathString("/Home/Admin");
o.LogoutPath=new PathString("/Home/Admin");
o.Cookie.HttpOnly = true;
o.ExpireTimeSpan=new TimeSpan(24,0,0);
});
LoginPath 是未登录时跳转的登录地址
Cookie.HttpOnly 设置cookies只读
ExpireTimeSpan 设置cookies过期时间,我设置的24小时
关键字: .net core Authentication
下一篇: NPM安装教程
1184
1976
1525
1352
4329
1657
514
1396
1283
524
9178
5753
5265
4887
4329
4042
3169
3092
3087
3046