I am having a curious problem... I have a large extranet in which the user first logs in with userName and password. Every page checks to see if the user's logged in, and if not, it kicks them back to the login screen. Once logged in, every page authenticates fine, but every once in a while, at seemingly random times, it kicks the user back to the login screen for some unknown reason.
I am setting 2 Session variables- one called "IsLoggedIn", which is either the string "true" or the string "false". Another is the user's name, simply called "userName". In my global.asax file, I define the Session variables like so:
On every page I check if the user is logged in like so:
Does anyone know what could be changing Session["isLoggedIn"] to something other than "true" at strange times? It seems to happen more often when running an update query of some type, but I've had it happen other times... any help is appreciated... thanks!
I am setting 2 Session variables- one called "IsLoggedIn", which is either the string "true" or the string "false". Another is the user's name, simply called "userName". In my global.asax file, I define the Session variables like so:
Code:
void Session_OnStart() {
Session["userName"] = "";
Session["isLoggedIn"] = "false";
}
void Session_OnEnd() {
Session["userName"] = "";
Session["isLoggedIn"] = "false";
}
On every page I check if the user is logged in like so:
Code:
if (Convert.ToString(Session["isLoggedIn"]) != "true") {
Response.Redirect("index.aspx");
}
Does anyone know what could be changing Session["isLoggedIn"] to something other than "true" at strange times? It seems to happen more often when running an update query of some type, but I've had it happen other times... any help is appreciated... thanks!