Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
523 views
in Technique[技术] by (71.8m points)

Session Expires after 15-20 Minutes in asp.net core 2.0. Any solution Not working

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...