O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Use Forms Authentication

Problem

You want to prevent users from accessing certain pages unless they have first authenticated themselves with a custom login page.

Solution

Implement forms authentication. You must create the login page, but ASP.NET keeps track of a user’s authentication status.

Discussion

Forms authentication is a flexible security model that allows you to prevent unauthenticated users from accessing certain pages. You write the code that performs the authentication, and ASP.NET uses a cookie to identify authenticated users. Users without the cookie are redirected to a login page when they try to access a secured page.

To implement forms authentication, you must take these steps:

  1. Configure forms authentication using the <authentication> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required