会话存储在哪里? [英] Where is the Session stored?

查看:55
本文介绍了会话存储在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问我的朋友,会话存储在哪里?在服务器或浏览器?他说,在服务器上.然后我说我认为保存在名为缓存的服务器上的东西".

I ask to my friend, where is session stored? At Server or Browser? He said, at the server. Then I said "I think things saved at server called cache".

然后,我去google搜索阅读文章,但我没有找到具体的正确答案,在MSDN上也没有具体答案.

Then, I go to google search reading article, but I found no specific correct answer, at MSDN too, no specific answer.

推荐答案

通常它保存在服务器的内存中,但您也可以拥有一个数据库支持的缓存.它从不缓存在客户端上,因为它可能包含用户不应该使用的信息,例如数据库的密码.

Usually it is saved in the server's memory, but you can also have a database backed cache. It is never cached on the client, since it can contain information that shouldn't be available to the user, like the password to your database.

可以找到保存会话状态的完整位置列表在 MSDN 上:

The full list of places where you can save the session state can be found on MSDN:

  • InProc 模式,将会话状态存储在 Web 服务器的内存中.这是默认设置.
  • StateServer 模式,将会话状态存储在称为 ASP.NET 状态服务的单独进程中.这可确保在 Web 应用程序重新启动时保留会话状态,并使 Web 场中的多个 Web 服务器可以使用会话状态.
  • SQLServer 模式将会话状态存储在 SQL Server 数据库中.这可确保在 Web 应用程序重新启动时保留会话状态,并使 Web 场中的多个 Web 服务器可以使用会话状态.
  • 自定义模式,可让您指定自定义存储提供程序.
  • 关闭模式,禁用会话状态.
  • InProc mode, which stores session state in memory on the Web server. This is the default.
  • StateServer mode, which stores session state in a separate process called the ASP.NET state service. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.
  • SQLServer mode stores session state in a SQL Server database. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.
  • Custom mode, which enables you to specify a custom storage provider.
  • Off mode, which disables session state.

这篇关于会话存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆