首页 新闻 会员 周边

cookie based session state 和 默认的session state 有什么区别?

0
悬赏园豆:15 [已关闭问题] 关闭于 2014-02-26 16:27

今天在写代码时调试发现web form程序里的每次请求sessionid都不一样?这样就导致每次换页都要查数据库运行一些基础数据的查询,影响性能。

网上查到的解析是这样的:

When using cookie-based session state, ASP.NET does not allocate storage for session data until the Session object is used. As a result, a new session ID is generated for each page request until the session object is accessed. If your application requires a static session ID for the entire session, you can either implement the Session_Start method in the application's Global.asax file and store data in the Session object to fix the session ID, or you can use code in another part of your application to explicitly store data in the Session object.

谁给解释下cookie based session state 和 默认的session state 有什么区别?

它有什么优点吗? 如何让它每次的SessionID不变?

空明流光的主页 空明流光 | 初学一级 | 园豆:106
提问于:2014-02-16 10:37
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册