Roles.CookieProtectionValue プロパティ

定義

クッキーにキャッシュされるロール名のセキュリティ保護の方法を示す値を取得します。

public:
 static property System::Web::Security::CookieProtection CookieProtectionValue { System::Web::Security::CookieProtection get(); };
public static System.Web.Security.CookieProtection CookieProtectionValue { get; }
static member CookieProtectionValue : System.Web.Security.CookieProtection
Public Shared ReadOnly Property CookieProtectionValue As CookieProtection

プロパティ値

クッキーにキャッシュされるロール名のセキュリティ保護の方法を示す CookieProtection 列挙値の 1 つ。 既定値は、All です。

次の例は、ASP.NET アプリケーションの Web.config ファイルの セクションにある roleManager 要素 system.web を示しています。 アプリケーションで インスタンスを使用し、属性を SqlRoleProvider に設定 cookieProtection することを Encrypted指定します。

<roleManager defaultProvider="SqlProvider"
  enabled="true"
  cacheRolesInCookie="true"
  cookieName=".ASPROLES"
  cookieTimeout="30"
  cookiePath="/MyApplication"
  cookieRequireSSL="false"
  cookieSlidingExpiration="true"
  cookieProtection="Encrypted" >
  <providers>
    <add
      name="SqlProvider"
      type="System.Web.Security.SqlRoleProvider"
      connectionStringName="SqlServices"
      applicationName="MyApplication" />
  </providers>
</roleManager>

注釈

ASP.NET アプリケーションのWeb.config ファイルで 属性を cookieProtection 設定することで、アプリケーションに対してロールがキャッシュされる Cookie の保護を指定できます。 属性は cookieProtectionCookieProtection ロール名が暗号化、検証、両方、またはどちらも行われないかを示す列挙値を受け取ります。

適用対象

こちらもご覧ください