sessionState の providers 要素 (ASP.NET 設定スキーマ)

[このドキュメントはプレビューのみを目的としており、以降のリリースで変更される可能性があります。プレースホルダーとして空白のトピックが含まれています。]

カスタム セッション状態ストア プロバイダーのコレクションを格納します。

この要素は、.NET Framework Version 2.0 で追加されました。

<providers>
   <add 
      
      
      
      
   />
   <remove />
   <clear/>
</providers>

属性および要素

以降のセクションでは、属性、子要素、および親要素について説明します。

属性

なし。

子要素

要素

Description

Add

省略可能な要素です。

セッション状態ストア プロバイダーのコレクションにプロバイダーを追加します。

clear

省略可能な要素です。

継承したセッション状態ストア プロバイダーへのすべての参照を削除し、現在の add 要素によって追加されたセッション状態ストア プロバイダーだけを使用できるようにします。

Remove

省略可能な要素です。

継承したセッション状態ストア プロバイダーへの参照をコレクションから削除します。

親要素

要素

Description

configuration

共通言語ランタイムおよび .NET Framework アプリケーションで使用されるすべての構成ファイルで必要なルート要素を指定します。

system.web

構成ファイルの ASP.NET 構成設定のルート要素を指定します。ASP.NET Web アプリケーションを構成する構成要素やアプリケーションの動作を制御する構成要素が含まれます。

sessionState

現在のアプリケーションのセッション状態設定値を構成します。

解説

providers 要素は、カスタム セッション状態ストア プロバイダーのコレクションを格納します。 カスタム セッション状態ストア プロバイダーは、SessionStateStoreProviderBase クラスから継承する必要があります。

アプリケーション コード内の sessionState 要素の構成値のアクセスおよび変更方法については、ProviderSettingsCollection および Providers の説明を参照してください。

既定の構成

次の既定の providers 要素は、Machine.config ファイルまたはルートの Web.config ファイルでは明示的に構成されません。 ただし、これはアプリケーションにより返される既定の構成です。

<sessionState
   <!-- Attribute settings. -->
>
   <providers>
      <clear />
   </providers>
</sessionState>

使用例

ASP.NET アプリケーションの Web.config ファイルを構成して、カスタム セッション状態ストア プロバイダーを使用する方法を、次のコード例に示します。 サンプル プロバイダーを含む、セッション状態ストア プロバイダーの実装については、「Implementing a Session State Store Provider」を参照してください。

<configuration>
  <connectionStrings>
    <add name="OdbcSessionServices" connectionString="DSN=SessionState;" />
  </connectionStrings>

  <system.web>
    <sessionState 
      cookieless="true"
      regenerateExpiredSessionId="true" 
      mode="Custom"
      customProvider="OdbcSessionProvider">
      <providers>
        <add name="OdbcSessionProvider"
          type="Samples.AspNet.Session.OdbcSessionStateStore"
          connectionStringName="OdbcSessionServices" 
          writeExceptionsToEventLog="false" />
      </providers>
    </sessionState>
  </system.web>
</configuration>

要素情報

構成セクション ハンドラー

SessionStateSection

構成メンバー

ProviderSettingsCollection

Providers

構成できる場所

Machine.config

ルート レベルの Web.config

アプリケーション レベルの Web.config

要件

Microsoft Internet Information Services (IIS) バージョン 5.0、5.1、または 6.0

.NET Framework Version 2.0

Microsoft Visual Studio 2003 または Visual Studio 2005

参照

処理手順

How to: Configure Specific Folders Using Location Settings

How to: Lock ASP.NET Configuration Settings

Reference

sessionState 要素 (ASP.NET 設定スキーマ)

sessionState の providers の add 要素 (ASP.NET 設定スキーマ)

sessionState の providers の clear 要素 (ASP.NET 設定スキーマ)

sessionState の providers の remove 要素 (ASP.NET 設定スキーマ)

system.web 要素 (ASP.NET 設定スキーマ)

sessionState の providers 要素 (ASP.NET 設定スキーマ)

configuration 要素 (全般設定スキーマ)

System.Configuration

System.Web.Configuration

SessionStateSection

ProviderSettingsCollection

Providers

SessionStateStoreProviderBase

概念

Implementing a Session-State Store Provider

Securing Session State

ASP.NET Configuration File Hierarchy

Securing Configuration

Configuration Inheritance

その他の技術情報

Protected Configuration

全般構成設定 (ASP.NET)

ASP.NET 構成設定

Configuring ASP.NET Applications

ASP.NET Configuration API