can anyone please provide me code on how to add sessions
How to use sessions
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
can anyone please provide me code on how to add sessions
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhishek YadavRank #217 · 11.3K reputationPosted Oct 19, 2022, 9:53 PM EDT
public class Startup { public void Configure(IApplicationBuilder app){ app.UseSession(); app.UseMvc(); app.Run(context => { return context.Response.WriteAsync("Hello World!"); }); } public void ConfigureServices(IServiceCollection services){ services.AddMvc(); services.AddSession(options => { options.IdleTimeout = TimeSpan.FromMinutes(60); }); } }Rajanikant HawaldarRank #110 · 20.2K reputationPosted Oct 20, 2022, 6:37 AM EDT
https://www.c-sharpcorner.com/article/how-to-use-session-in-asp-net-core
Naresh BeniwalRank #365 · 6.8K reputationPosted Oct 30, 2022, 12:56 PM EDT
https://www.c-sharpcorner.com/UploadFile/225740/introduction-of-session-in-Asp-Net/