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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajeesh MenothPosted Dec 5, 2019, 7:07 AM
Jaimin ShethiyaPosted Dec 5, 2019, 6:12 AM
can you please check the below link
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-3.1
Thanks
Ramachandran MPosted Dec 4, 2019, 12:07 AM
{
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();
}
}
Nitin BhardwajPosted Dec 4, 2019, 12:00 AM
Rajeesh MenothPosted Dec 3, 2019, 11:53 PM
Nitin BhardwajPosted Dec 3, 2019, 11:47 PM