码迷,mamicode.com
首页 > Web开发 > 详细

Asp.net Session保存到Redis: 使用 RedisSessionStateProvider

时间:2016-04-14 17:48:20      阅读:1545      评论:0      收藏:0      [点我收藏+]

标签:

Install-Package Microsoft.Web.RedisSessionStateProvider

依赖于: 

Dependencies

 

 1 <system.web>
 2     <authentication mode="None" />
 3     <compilation debug="true" targetFramework="4.5" />
 4     <httpRuntime targetFramework="4.5" />
 5     <sessionState mode="Custom" customProvider="MySessionStateStore">
 6       <providers>
 7         <!-- Either use ‘connectionString‘ and provide all parameters as string OR use ‘host‘,‘port‘,‘accessKey‘,‘ssl‘,‘connectionTimeoutInMilliseconds‘ and ‘operationTimeoutInMilliseconds‘. -->
 8         <!-- ‘throwOnError‘,‘retryTimeoutInMilliseconds‘,‘databaseId‘ and ‘applicationName‘ can be used with both options. -->
 9         <!--
10           <add name="MySessionStateStore" 
11             host = "127.0.0.1" [String]
12             port = "" [number]
13             accessKey = "" [String]
14             ssl = "false" [true|false]
15             throwOnError = "true" [true|false]
16             retryTimeoutInMilliseconds = "5000" [number]
17             databaseId = "0" [number]
18             applicationName = "" [String]
19             connectionTimeoutInMilliseconds = "5000" [number]
20             operationTimeoutInMilliseconds = "1000" [number]
21             connectionString = "<Valid StackExchange.Redis connection string>" [String]
22             loggingClassName = "<Assembly qualified class name that contains logging method specified below>" [String]
23             loggingMethodName = "<Logging method should be defined in loggingClass. It should be public, static, does not take any parameters and should have a return type of System.IO.TextWriter.>" [String]
24           />
25         -->
26         <add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="192.168.5.102" port = "6379" accessKey="" ssl="false" />
27       </providers>
28     </sessionState>
29   </system.web>

 

Asp.net Session保存到Redis: 使用 RedisSessionStateProvider

标签:

原文地址:http://www.cnblogs.com/wucg/p/5391629.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!