System.Web.Security.FormsAuthenticationTicket Class

Provides access to properties and values of the ticket used with forms authentication to identify users. This class cannot be inherited.

See Also: FormsAuthenticationTicket Members


public sealed class FormsAuthenticationTicket


The System.Web.Security.FormsAuthenticationTicket class is used to create an object that represents the authentication ticket that is used by forms authentication to identify an authenticated user. The properties and values of a forms-authentication ticket are converted to and from an encrypted string that is stored in a cookie or in the URL.

The System.Web.Security.FormsAuthentication class provides an FormsAuthentication.Encrypt(FormsAuthenticationTicket) method to create a string value that can be stored in a cookie or in the URL from a System.Web.Security.FormsAuthenticationTicket. The System.Web.Security.FormsAuthentication class also provides a FormsAuthentication.Decrypt(string) method to create a System.Web.Security.FormsAuthenticationTicket object from the encrypted authentication ticket retrieved from the forms-authentication cookie or the URL.

The System.Web.Security.FormsAuthenticationTicket for the current authenticated user can be accessed using the FormsIdentity.Ticket property of the System.Web.Security.FormsIdentity class. You can access the current System.Web.Security.FormsIdentity object by casting the System.Security.Principal.IPrincipal.Identity property of the current System.Web.HttpContext.User as type System.Web.Security.FormsIdentity.


Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0,