加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

ASP.NET会话已过期或无法找到 – >因为Session.SessionID发生

发布时间:2020-12-15 22:17:53 所属栏目:asp.Net 来源:网络整理
导读:1.-我正在使用报告服务,有时我收到此错误ASP.NET会话已过期或在我尝试加载报告时找不到. 2.-我意识到,即使用户是相同的,Session.SessionID属性也会发生变化.如果它没有更改,则加载报告.我的意思是,如果我多次刷新报告,只要Session.SessionID与最后一个相同,
1.-我正在使用报告服务,有时我收到此错误ASP.NET会话已过期或在我尝试加载报告时找不到.

2.-我意识到,即使用户是相同的,Session.SessionID属性也会发生变化.如果它没有更改,则加载报告.我的意思是,如果我多次刷新报告,只要Session.SessionID与最后一个相同,就会加载报告.

3.-微软文档说:

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.

If your application uses cookieless session state,the
session ID is generated on the first page view and is maintained for
the entire session.

关键是我不能使用无cookie会话状态,因为我需要cookie.

我该怎么做才能避免这个错误?或者我该怎么做才能避免Session.SessionID在每个请求上更改?

解决方法

您可能正在存储会话InProcess.尝试将其更改为会话状态服务器.你可以找到更多细节 here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读