尽快进行多用户会话问题 [英] Multiple User Session Issue ASAP

查看:122
本文介绍了尽快进行多用户会话问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我有一个接口,其中包含3个派生类.在登录页面上,我声明了接口的对象.当用户单击登录按钮时,根据用户状态,我创建派生类之一,并将接口对象添加到会话"中.但是,一旦用户登录并进入某些页面,则当多个用户尝试执行同一任务时,会话将获取另一个用户的值.
是否有解决此问题的解决方案?
我正在使用C#,ASP.NET.如果有人不明白我的问题,请告诉我,以便我更详细地解释.

In my application I have one interface which has 3 derived classes. On my login Page I declared the object for an interface. When a user clicks login button, based on the user status I create one of the derived classes and add the interface object into a "Session". But once the user is login and inside some pages, when the multiple user try to do the same task, the session gets values of another user.
Is there any solution to solve this issue?
I am working on C#, ASP.NET. If anyone does not understand my question please let me know, so I can explain it in more details.

Thank.

推荐答案

会话对象对于用户(客户端浏览器)是唯一的,并且由存储在客户端cookie中的会话ID定义.

不要忘记,在服务器端,默认情况下,会话对象在站点上一次浏览器活动之后会保留20分钟.

因此,如果您是在模拟不同用户的同一台计算机上进行测试,则可能会看到上一个会话对象.

如果您的多个用户来自同一浏览器/会话,那么您当然会遇到此问题,否则就不会.
如果您想获得更具体的答案,则应显示代码.

此刻,也许我的回答会帮助您更好地分析问题.
祝你好运.
The session object is unique for a user(client browser) and is defined by the session id which is stored in the client cookie.

Do not forget that on the server side the session object by default is being kept for 20 minutes after the last browser activity on the site.

So if you are testing from the same computer impersonating different users you may see the previous session object.

If your multiple user comes from the same browser/session, then, of course, you will have this problem, otherwise you should not.
If you want to have more specific answer you should show the code.

At the moment, maybe my answer would help you better analyze the problem.
Good luck.


这篇关于尽快进行多用户会话问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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