Protection Enum Enum
Defines the type of encryption, if any, to use for cookies.
public enum class FormsProtectionEnum
public enum FormsProtectionEnum
type FormsProtectionEnum =
Public Enum FormsProtectionEnum
Specifies that the application use both data validation and encryption to help protect cookies. This option uses the configured data-validation algorithm (based on the
Specifies that cookies are encrypted using Triple-DES or DES, but data validation is not performed on cookies. Cookies used this way might be subject to chosen plaintext security attacks.
Specifies that the application use a validation scheme to verify that the contents of an encrypted cookie have not been altered in transit. The cookie is created by concatenating a validation key with the cookie data, computing a Message Authentication Code (MAC), and appending the MAC to the outgoing cookie.
The following example shows how to use the
FormsProtectionEnum enumeration. Refer to the code example in the FormsAuthenticationConfiguration class to learn how to get the section.
// Get the current Protection. FormsProtectionEnum currentProtection = formsAuthentication.Protection; // Set the Protection property. formsAuthentication.Protection = FormsProtectionEnum.All;
' Get the current Protection. Dim currentProtection As FormsProtectionEnum = _ formsAuthentication.Protection ' Set the Protection property. formsAuthentication.Protection = FormsProtectionEnum.All
If you select the
All value, the system uses the configured data-validation algorithm, based on the machineKey tag. This is the default and recommended value.
If you select
None, cookies might be subject to plaintext attacks.
If you select
Validation, the cookie is created using cookie validation by concatenating a validation key with the cookie data, computing a Message Authentication Code (MAC), and appending the MAC to the outgoing cookie.