I am new to .NET. I am creating a site on which there is an admin section that should only be visible to log in. I created a login code, and as soon as the user is authenticated, I will then assign them a session variable. My question is: is there a more efficient way to check the session variable, and not on the next page on the next page?
protected void Page_Load(object sender, EventArgs e) { checkSession(); } public void checkSession() { if (Session["LoggedIn"] != "true") { Response.Redirect("default.aspx"); } }
Thank you!
source share