Hi,
How to check session timeout before controller execution in .net core
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
Rajeesh MenothRank #118 · 18.4K reputationPosted Dec 5, 2019, 2:07 AM EST
Nitin BhardwajRank #139 · 16.1K reputationPosted Dec 3, 2019, 6:47 PM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Dec 3, 2019, 6:53 PM EST
Nitin BhardwajRank #139 · 16.1K reputationPosted Dec 3, 2019, 7:00 PM EST
Ramachandran MRank #2,660 · 522 reputationPosted Dec 3, 2019, 7:07 PM EST
{
if (context.HttpContext.Session.Get("ID") != null)
{
context.Result = new BadRequestObjectResult("Model is null");
return;
}
}
public class HomeController : Controller
{
// GET: /
public IActionResult Index()
{
HttpContext.Session.SetString("ID", "Ram");
return View();
}
}
Jaimin ShethiyaRank #177 · 13.7K reputationPosted Dec 5, 2019, 1:12 AM EST
can you please check the below link
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-3.1
Thanks