惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - avisnet

枚举浏览器窗口 关闭弹出式IE浏览器窗口编程 iframe自适应高度 - avisnet - 博客园 实现集合类的帮助函数 FormView 在对话框里面使用ON_UPDATE_COMMAND_UI映射工具条 automation服务器不能创建对象 汇率 无题 [转]猪的爱情故事 在新窗口中打开网页,同时关闭原有窗口 删除文件至回收站而不是永久删除 低层键盘钩子 C++编译器默认声明的成员函数 Session Data Is Lost When You Use ASP.NET InProc Session State Mode [转]LINK : warning LNK4089: all references to "xxx.dll" discarded by /OPT:REF VC++中消除警告 const与typedef的中高级使用 在 ASP.NET 中执行 URL 重写
使用SqlServer模式的会话状态管理
avisnet · 2006-09-21 · via 博客园 - avisnet

 使用InProc模式的会话状态管理时,会话数据存储在ASP.NET工作进程(Aspnet_wp.exe)的内存中。使用这种模式可以快速的存取数据,但是一旦ASP.NET工作进程重启后,会话状态数据就会丢失。
SQL Server模式将会话状态数据存储在SQL Server数据库中,可以解决会话状态数据丢失的问题。

下面的步骤描述了通过运行InstallSqlState.sql 和 UninstallSqlState.sql两个脚本文件配置Sql Server管理会话状态的方法:

1.在查询分析器中运行InstallSqlState.sql脚本。这个脚本可以在下面其中一个目录中找到:

      system drive\WINNT\Microsoft.NET\Framework\version\
      system drive\Windows\Microsoft.NET\Framework\version\

如果先前已配置过SqlServer模式的会话状态管理,必须首先运行脚本UninstallSqlState.sql移除原先的配置。注意移除之前需要停止w3svc进程,移除之后再将其启动。

停止w3svc进程:在命令提示符窗口输入net stop w3svc
启动w3svc进程:在命令提示符窗口输入net start w3svc

 如果启动了VS2005中的ASP.NET Development Server,也需要停止。

 2. 修改应用程序的web.config文件:

</system.web>

<sessionState

mode="SQLServer"

sqlConnectionString="data source=127.0.0.1;user id=sa;password=sa"

cookieless="false"

timeout="20"/>

</system.web>

 如果在运行UninstallSqlState.sql之前没有停上w3svc进程,将会收到下面的错误信息:

         Cannot drop the database 'ASPState' because it is currently in use

 配置好SqlServer模式的会话状态管理后,ASP.NET将在tempdb数据库中创建数据表ASPStateTempSessions 和ASPStateTempApplications,以保存会话状态数据,因此重启Sql Server将会丢失存储在ASPStateTempSessions 和ASPStateTempApplications中的会话数据。

 这两个脚本文件的永久化版本是InstallPersistSqlState.sql 和 UninstallPersistSqlState.sql,通过在ASPState数据库中创建这两个表要解决这个问题。