Asp.net Session保存到Redis: 使用 RedisSessionStateProvider
2024-10-11 02:54:03
Install-Package Microsoft.Web.RedisSessionStateProvider
依赖于:
Dependencies
- StackExchange.Redis.StrongName (>= 1.0.488)
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<sessionState mode="Custom" customProvider="MySessionStateStore">
<providers>
<!-- Either use 'connectionString' and provide all parameters as string OR use 'host','port','accessKey','ssl','connectionTimeoutInMilliseconds' and 'operationTimeoutInMilliseconds'. -->
<!-- 'throwOnError','retryTimeoutInMilliseconds','databaseId' and 'applicationName' can be used with both options. -->
<!--
<add name="MySessionStateStore"
host = "127.0.0.1" [String]
port = "" [number]
accessKey = "" [String]
ssl = "false" [true|false]
throwOnError = "true" [true|false]
retryTimeoutInMilliseconds = "5000" [number]
databaseId = "0" [number]
applicationName = "" [String]
connectionTimeoutInMilliseconds = "5000" [number]
operationTimeoutInMilliseconds = "1000" [number]
connectionString = "<Valid StackExchange.Redis connection string>" [String]
loggingClassName = "<Assembly qualified class name that contains logging method specified below>" [String]
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]
/>
-->
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="192.168.5.102" port = "6379" accessKey="" ssl="false" />
</providers>
</sessionState>
</system.web>
最新文章
- 使用Rest访问Redis中的数据
- workspace路径有中文情况会报java.net.MalformedURLException: unknown protocol: d错误
- Direct3D 10学习笔记(四)——Windows编程
- java历史
- ListView中使用type需要注意的东西
- WWF3入门<;第一篇>;
- RxJava开发精要3-向响应式世界问好
- Vxworks、QNX、Xenomai、Intime、Sylixos、Ucos等实时操作系统的性能特点
- Apache 服务器
- TagHelper+Layui封装组件之Radio单选框
- java finalize方法总结、GC执行finalize的过程
- SpringBoot+Dubbo+Zookeeper整合搭建简单的分布式应用
- SQL Server数据库————模糊查询和聚合函数
- jdbc连接数据库以及crud(简单易懂,本人亲测可用 有源代码和数据库)
- eclipse之常用快捷键
- stlcky footers布局小技巧
- Sequelize 学习笔记(11)- Migrations 迁移
- TopShelf 自动配置Service测试
- elastic search 查询
- MyBatis Generator介绍
热门文章
- GridView点击排序
- Fengshui-[SZU_B40]
- 关于后台管理linkbutton按钮几个重要属性的理解
- log4j - 配置文件
- hdu 1735 字数统计
- hdu Rescue
- html5文章 -- 应用HTML5 开发手机APP
- How to: Fix a network printer suddenly showing as offline in Windows Vista, 7 or 8 &#171; Robin&#39;s Blog
- Win2003+Powershell2.0下无权限解锁账号
- JSP编程-步步为营