Handling FormsAuthentication Events
To customize how the forms authentication ticket is handled and how the User property is set, you can handle the FormsAuthentication_OnAuthenticate event in your application's Global.asax file. Although it is common to allow forms authentication manage these tasks for you, your applications might have specific requirements, such as setting the User property to a custom class that implements the IPrincipal interface. In those cases, your application should handle the FormsAuthentication_OnAuthenticate event and perform cookie management. For more information, see FormsAuthenticationEventHandler.
See Also
Other Resources
ASP.NET Web Application Security
Forms Authentication Provider