Sometimes we do some systems that require identity verification. We refuse to use session for judgment on every page. At this time, we can set the authentication method for logging on to the website in the configuration file. forms authentication is fine,
Forms authentication: when a user logs on to the system, the system wants the server to send a request. The server request does not contain valid authentication cookies, and the web service points the page to a specific page.
Configuration file configuration example:
<System. web>
<Authentication mode = "Forms"> <! -- Authentication step 1: Set it to forms authentication --> mode. You can also select other authentication methods, as well as windows and passport.
<Forms loginUrl = "productManage. aspx" timeout = "2880"/> <! -- Page not pointed to when identity authentication fails -->
</Authentication>
<Authorization> <! -- Step 2 of identity verification: Set To Deny Access From anonymous users -->
<Deny users = "? "/> You can also set here to allow those users to come in, for example: <allow/>
</Authorization>
</System. web>
You can try ......