Last post Oct 29, 2019 11:40 AM by nopatchforhumancruelty
Oct 29, 2019 10:31 AM|nopatchforhumancruelty|LINK
Hi, I'm implementing a Web Application using ASP.NET MVC and for views I'm using Razor view.
My Web Application contains some page, for example a Login page (which is the initial page). To manage the session, I've created a
SessionManagement class which is used in my controller.
One week ago i've started my Web Application and I didn't do anything for many time (because I was far away from my workstation); when I returned to my workstation, I've tried to navigate in my Web Application, but an error occurs; it was as if all
the variables had been "cleaned up".
So I want something like that: if the user doesn't use the Web App for 30 minutes, it is redirect to the
How I can do that?
Oct 29, 2019 11:40 AM|nopatchforhumancruelty|LINK
If someone is interested, I've solved this problem in the following way:
I've added those lines to every action in my controller:
if (TempData["SessionData"] == null)
and GeneralError action contains:
SessionManagementModel session = new SessionManagementModel();
session.LoginError = "SESSION EXPIRED!";
session.Flag1 = 0;
session.Flag2 = 0;
TempData["sessionData"] = session;