Creates a string containing an encrypted forms-authentication ticket suitable for use in an HTTP cookie.
- ticket
- The System.Web.Security.FormsAuthenticationTicket object with which to create the encrypted forms-authentication ticket.
A string containing an encrypted forms-authentication ticket.
The actual method to encrypt the data depends on the setting in the "mode" attribute in the <authentication> section in the <system.web> section of the application configuration.
The possible values are:
Value | Effect |
---|---|
All | Checksums and encrypts the ticket; Prevents tampering and visibility from the user |
None | Encodes the tickets as a hex string, the ticket can be tampered and the content viewed by a client |
Encryption | Encrypts the tickets, but does not checksum the results. |
Validation | Appends a checksum to the sequence, to avoid a client tampering with the data. |
The default mode is "All".