UserName and Password Validation
-
Hi, I am trying to make an ASP page that requires username and password validation. After the user's username and password is validated, Session("loginValidated") is set to true and the user is redirected to the main webpage (let's call is main.aspx). In main.aspx, the Session("loginValidated") is checked on load to see if the user got there by just entering the username and password directly. The problem is that when the user leaves the main.aspx page (in the same session) and then comes back to it, he shouldnt be able to see the information. How do I stop them from coming back to the page directly? Thanks in advance.
-
Hi, I am trying to make an ASP page that requires username and password validation. After the user's username and password is validated, Session("loginValidated") is set to true and the user is redirected to the main webpage (let's call is main.aspx). In main.aspx, the Session("loginValidated") is checked on load to see if the user got there by just entering the username and password directly. The problem is that when the user leaves the main.aspx page (in the same session) and then comes back to it, he shouldnt be able to see the information. How do I stop them from coming back to the page directly? Thanks in advance.
You have to define small function or just check your Session("loinValidated") = true or not, if it is false redirect it to login page. use this check to all pages except login page. if Session("loinValidated") = false then response.redirect("Login.aspx") End if if you want prevent caching the pages use this line on top of the every page and then check validation Response.Cache.SetCacheability(HttpCacheability.NoCache) Regards Ather Ali Shaikh Sr. Software Engineer eIntelligence Pvt. Ltd. Karachi, Pakistan.