Good! In a previous question I wanted to know how to keep a variable for the whole site and be able to use it when needed: Previous question
But now I'm getting this error very often ...
I tried this and it does not work, among many other tests I did, like adding:
//prueba 1
if (per_App0 == 0 || per_App0 == null)
{
FormsAuthentication.RedirectToLoginPage();
}
// prueba 2
per_App0 = new (int)Session["per_App0"];
//prueba 3
new per_App0 = (int)Session["per_App0"];
This error does not appear immediately the page is loaded, if I log in and go to the page it works normally, but after a while X when the page refreshes the error appears, so I guess it is as if the session, but if I give back and go back to another page I realize that the session is still active because it does not ask for a password or return to the login.