RoleManagerSection.CookieProtection プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ロール名をキャッシュする Cookie を保護するために使用されるセキュリティの種類を取得または設定します。
public:
property System::Web::Security::CookieProtection CookieProtection { System::Web::Security::CookieProtection get(); void set(System::Web::Security::CookieProtection value); };
[System.Configuration.ConfigurationProperty("cookieProtection", DefaultValue=System.Web.Security.CookieProtection.All)]
public System.Web.Security.CookieProtection CookieProtection { get; set; }
[<System.Configuration.ConfigurationProperty("cookieProtection", DefaultValue=System.Web.Security.CookieProtection.All)>]
member this.CookieProtection : System.Web.Security.CookieProtection with get, set
Public Property CookieProtection As CookieProtection
プロパティ値
ロール名がキャッシュされる Cookie 内で使用されるセキュリティ保護の種類。 既定値は、All です。
- 属性
例
次のコード例は、 CookieProtection プロパティの使用方法を示しています。 このコード例は、 RoleManagerSection クラスに提供されるより大きな例の一部です。
// Display CookieProtection property.
Console.WriteLine("CookieProtection: {0}",
configSection.CookieProtection);
' Display CookieProtection property.
Console.WriteLine("CookieProtection: {0}", _
configSection.CookieProtection)
注釈
CookieProtection プロパティは、Cookie 内の情報を安全に格納する方法を示します。 ASP.NET アプリケーションの Web.config ファイルに cookieProtection 属性を設定することで、アプリケーションのロールがキャッシュされる Cookie のセキュリティの種類を指定できます。
cookieProtection属性は、All、Encryption、None、またはValidationのCookieProtection列挙値を受け取ります。 既定値は、All です。 データ検証と暗号化の両方が Cookie の保護に役立つ場合は、 CookieProtection プロパティの既定値を使用してください。 Cookie の保護を強化するために、 CookieRequireSSL プロパティを true に設定することもできます。