Hello Buddies I hope you all good. I am having session expiration problem. it took weeks but not solved yet I hope I will get help from here.
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;
});
I have Tried this this is my startup File apart from this I have changes the idleTimeout from IIS also. not working in my case. this is the Image of settings in my iis. the Settings inside the IIS
But Not coming to the point of solution.
Can Anyone of you provide an example code or proper settings that may be missing from my side I have produced a big application. moving from session to other way is not possible for me.