ASP.NET 严重会话问题

发布于 2024-09-24 01:01:40 字数 262 浏览 1 评论 0原文

我有一种丑陋的情况。

我有一个大型程序,在使用 ASP.NET 3.5 C# 构建的 CRM 系统中,使用会话将数据从一个页面转移到另一个页面

问题是,如果您在同一浏览器中打开该程序的两个实例并浏览同一页面,会话当然会被覆盖。

正如您可以想象的那样,这是一个巨大的问题,也是系统的巨大责任。

在这里做什么是正确的?我使用了大量的 AJAX,并且需要在页面之间传递对象,因此 url 参数在这里并不是一个真正的选项。

有什么建议吗?

I have a kind of an ugly situation.

I have a big program that uses session to carry over data from one page to another in a CRM system build in ASP.NET 3.5 C#

The problem is that if you have two instance of this program open in the same browser and browse the same page, the sessions of course gets overridden.

As you can imagine, this is a huge issue and a huge liability for the system.

What is the right thing to do here? I use tons of AJAX, and need to pass objects from page to page, so url parameters is not really an option here.

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

说谎友 2024-10-01 01:01:40

你的web.config sessionState配置了什么?我认为在您的情况下,您可以通过如下配置来降低问题的严重性:

<configuration>
   <system.web>
      <sessionState mode="InProc" cookieless="true" timeout="20"/>
      OR
      <sessionState cookieless="true" regenerateExpiredSessionId="true" timeout="20" />
   </system.web>
</configuration>

但后者会破坏您的 URL。最终,ASP.NET 将会话 ID 插入到您的 URL 中,例如 http://www.example.com/(S(lit3py55t21z5v55vlm25s55))/orderform.aspx更多相关信息

What is your web.config sessionState configured? I think in your situation you can reduce the severity of your problem by configuring it as follows:

<configuration>
   <system.web>
      <sessionState mode="InProc" cookieless="true" timeout="20"/>
      OR
      <sessionState cookieless="true" regenerateExpiredSessionId="true" timeout="20" />
   </system.web>
</configuration>

But the latter is going to mangle your URLs. You'll end up with ASP.NET inserting session IDs into your URLs, something like http://www.example.com/(S(lit3py55t21z5v55vlm25s55))/orderform.aspx. More about it here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文