Home > Blockchain >  Asp.net block users from skipping login with url
Asp.net block users from skipping login with url

Time:11-16

i am new at asp.net i have done a login page that works with session and redirects the username to the main menu. Now i want to make it impossible for users to skip login with url example

From

test-web/login

To

test-web/mainmenu

So when someone tries to change the url they will stay in the same page (Login). Is there any video on youtube or a code example i can see so i can try to make it myself. Thank you in advance.

CodePudding user response:

Go to the main menu and make this code

if(Session["New"] == null)
{
Response.Redirect("Login");
}
else
{
//Here you add the session to redirect if login succesfull.
}
  • Related