I don't even know where to start to ask for help in this problem so I will just put it all out there and please accept my apologies for the length of the code.
This application was written in 1.1 and was apparently working. What I cannot figure out is how to get it to work in 2.0 with the least amount of changes. The least amount of changes is very important as this type of code appears everywhere in this 1500 page application. It appears that the various variables and objects were being passed from one page to another but now it does not work. The last bit of code (in orange below) does not recognize the object 'credentials' and I need someone to tell me how to make that work, again, with the least amount of changes. Thank you.
Here is the sequence of this application. When you see an include file, the color of the text will tell you if that is part of the file.
(default = index.aspx, redirect to: login.aspx)
index.aspx
<!-- #include file="includes/mySystemObjectsFile.aspx" -->
<%@ Import Namespace="CompanyName.Authentication" %>
Credentials credentials = null;
/* Credentials Session Variables. */
if (Session["credentials"] == null) {
credentials = new Credentials();
Session["credentials"] = credentials;
} else {
credentials = (Credentials)Session["credentials"];
}
<!-- #include file="includes/mySecurityCheckFile.aspx" -->
<%
if (!credentials.getIsLoggedIn()) {
Response.Redirect("/login.aspx");
return;
}
%>