在SQL Server数据库里存储Session
来源:56doc.com 资料编号:5D5895 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9A5D5895
资料以网页介绍的为准,下载后不会有水印.资料仅供学习参考之用. 密 保 惠 帮助
资料介绍
在SQL Server数据库里存储Session(中文3700字+英文2800字)
HTTP是个状态很不确定的协议,为了允许用户通过请求保存状态信息,ASP.NET提供了Session存储机制。这些Session变量按每个用户被存储起来。在传统的ASP里,你只能在Web服务器的内存里暂时存储Session变量,但是这个方法已经被证明了在扩展性和可依赖性上的不足。在ASP.NET里,你可以为你的每个请求定制Session状态存储。本文将探讨存储Session变量可伸缩性和可靠性都很好的方式之一的SQL Server 。
在传统的ASP里 ,默认的Session状态保存在服务器的内存中。 但是,这种做法带来两方面的问题:
Storing Session State in a SQL Server Database
Introduction
HTTP is a stateless protocol. To allow users save to state information across requests, ASP.NET provides Session storage. The session variables are stored on per-user basis. In ASP classic, you can store session variables only in the Web server's memory. However, this approach proves to be poor in terms of scalability and reliability. In ASP.NET 2.0, however, you can customize the session state store as per your requirement. This article will explore one of the scalable and reliable approaches for storing session variables—SQL Server.
As in classic ASP, by default the session state is maintained in the Web server's memory. However, this approach poses two problems:
It overburdens the server, affecting the Web site's scalability |