问题描述
您好哥们我希望大家都好。我有会话过期的问题。花了几个星期,但没有解决 但我希望我会从这里得到帮助。
services.Configure<CookiePolicyOptions>(options =>
{
});
services.AdddistributedMemoryCache();
services.AddSession(
options =>
{
options.IdleTimeout = TimeSpan.FromDays(1);
});
services.AddMemoryCache();
services.AddMvc().AddJsonoptions(options => options.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver());
services.AddTransient<IUserStore<ApplicationUser>,UserStore>();
services.AddTransient<IRoleStore<IdentityRole>,RoleStore>();
services.AddIdentity<ApplicationUser,IdentityRole>()
.AddDefaultTokenProviders();
services.Configure<IISOptions>(options =>
{
options.ForwardClientCertificate = true;
});
services.ConfigureApplicationCookie(o =>
{
o.Cookie.Name = ".ERP_Cockie";
o.ExpireTimeSpan = TimeSpan.FromHours(24);
o.SlidingExpiration = true;
});
我已经试过这个,这是我的启动文件 除此之外 我有变化的idleTimeout从IIS也。在我的情况不工作。 这是在我的IIS设置的图像。 the Settings inside the IIS
但不来的溶液的点。
这是你谁能提供一个例子代码或适当的设置,可以从我的身边缺少 我已经产生了很大的应用。从会话到其他方式移动是不可能的,我
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)