This documentation is archived and is not being maintained.

RoleManagerSection::CookieProtection Property

Gets or sets the type of security that is used to protect the cookie that caches role names.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute(L"cookieProtection", DefaultValue = CookieProtection::All)]
public:
property CookieProtection CookieProtection {
	CookieProtection get ();
	void set (CookieProtection value);
}

Property Value

Type: System.Web.Security::CookieProtection
The type of security protection used within the cookie where role names are cached. The default is All.

The CookieProtection property describes how information in a cookie is securely stored. You can specify the security type of the cookie where roles are cached for your application by setting the cookieProtection attribute in the Web.config file for your ASP.NET application. The cookieProtection attribute takes a CookieProtection enumeration value of All, Encryption, None, or Validation. The default is All. Be sure to use the default value for the CookieProtection property if you want both data validation and encryption to help protect the cookie. To improve the protection of your cookie, you can also set the CookieRequireSSL property to true.

The following code example demonstrates how to use the CookieProtection property. This code example is part of a larger example provided for the RoleManagerSection class.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: