flnMichael
Programmer
Hey,
I have a couple pages that require a session variable throughout each page. After I log in at the login page and enter the right username and password, the session is set to 1 for Admin and 2 for others.
I have followed the path of the logon page and have found that before it leaves to redirect to another page, the session is set correctly. On the top of my next page, I have this snippet of code:
This will always redirect. When I play around with the code, I find that the session variable isn't always the same (either a "0" or "2" shows up as the value, and this is random), even though it is always correct when I response.write it on the login page ("1"). I have changed my browser settings to check for a newer version of the page every visit, but no different. Can anyone tell me what may be going on?
Thanks
Mike
I have a couple pages that require a session variable throughout each page. After I log in at the login page and enter the right username and password, the session is set to 1 for Admin and 2 for others.
Code:
If objRS("Password") = Request.form("Password") Then
if Request.form("Username") <> "Admin" then
session("Admin") = "2"
else
session("Admin") = "1"
end if
end if
session("error") = "0"
Response.Redirect("AdminPage.asp")
I have followed the path of the logon page and have found that before it leaves to redirect to another page, the session is set correctly. On the top of my next page, I have this snippet of code:
Code:
dim rights
rights = session.Value("Admin")
if rights <> "1" then
if rights <> "2" then
Response.Redirect("Login.asp")
end if
end if
This will always redirect. When I play around with the code, I find that the session variable isn't always the same (either a "0" or "2" shows up as the value, and this is random), even though it is always correct when I response.write it on the login page ("1"). I have changed my browser settings to check for a newer version of the page every visit, but no different. Can anyone tell me what may be going on?
Thanks
Mike