使用MongoDB來存儲蓄所ASP.NET Session

jopen 11年前發布 | 16K 次閱讀 MongoDB .NET開發

MongoDB ASP.NET Session Store Provider用于將ASP.NET的 Session 狀態存儲到 MongoDB 數據庫中。

在 web.config 中的配置方法:

<configuration>
  <connectionStrings>
    <add name="MongoSessionServices" connectionString="mongodb://localhost" />
  </connectionStrings>
  <system.web>
    <sessionState
        mode="Custom"
        customProvider="MongoSessionStateProvider">
      <providers>
        <add name="MongoSessionStateProvider"
             type="MongoSessionStateStore.MongoSessionStateStore"
             connectionStringName="MongoSessionServices"
             writeExceptionsToEventLog="false"
             fsync="false"
             replicasToWrite="0" />
      </providers>
    </sessionState>
  </system.web>
</configuration>

項目主頁:http://www.baiduhome.net/lib/view/home/1363222688953

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!