让多个用户访问相同的基于asp.net的会话 [英] Get multiple users to access the same asp.net-based session

查看:67
本文介绍了让多个用户访问相同的基于asp.net的会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



因此,我一直在尝试构建的功能之一是一个用户可以创建临时会话/页面的功能,应该是他们邀请的用户可以访问,即发送查看/协作的邀请。我的问题是如何创建临时asp.net页面的会话/实例,并让多个用户异步查看同一个会话,因为它将由用户实时更新。是否有任何特定的方法可以让用户在活动时保持对同一会话的访问权限?我可以想象的唯一另一件事就是聊天室,因为它管理哪些用户是在线而哪些不是。是否有某种asp.net库已经支持这个?我是不是在想这个?

Hi All

So one of the features I've been trying to construct is a feature where one user can create a temporary session/page, and should be accessible to users they "invite", ie send an invitation to view/collaborate. My issue is how to create sessions/instances of a temporary asp.net page and get multiple users to view the very same session asynchronously, as it will be updated by the users in real-time. Is there any particular way to get users to keep access to the same session while its active? The only other thing I can imagine that is similar is maybe a chat room, in that it manages which users are "online" and which aren't. Is there some kind of asp.net library that already supports this? Am I over-thinking this?

推荐答案

如果我理解你,你就不能使用会话 [ ^ ]对象。为什么? ASP.NET页面使用无内存HTTP协议。这意味着每次客户端请求基于WEB的应用程序时,HTTP都不知道调用者的身份。它将请求转发给Web服务器。 当客户端连接到Web应用程序时,Session对象用于将数据唯一存储到特定客户端。例如,当用户登录到Web应用程序时,他的个人信息,如登录名,密码等,可以存储在会话变量中。



然而......

一些有用的信息,你可以在这里找到:跨应用程序分享ASP.NET会话状态 [ ^ ]



但是......

我真的相信你在谈论集中数据缓存 [ ^ ]。正如本文中所讨论的, SqlDependency类 [ ^ ]将是您的最佳解决方案。您将能够实时在用户之间共享数据。请按照以下和所有相关链接进行操作。

ASP.NET应用程序中的SqlDependency [ ^ ]
If i understand you well, you can NOT use Session[^] object. Why? The ASP.NET pages use a memory-less HTTP protocol. It meant that every time a client requests WEB based application, HTTP has no idea of the caller's identity. It forwards the request to the Web server. The Session object is used to store data unique to a particular client while that client is connected to a Web application. For example, when a user logs on to a Web application, his personal information like login, name, password, etc. could be stored in a Session variables.

Nevertheless...
Some useful information, you'll find here: Sharing ASP.NET Session State Across Applications[^]

But...
I really do believe you're talking about centralized data caching[^]. As is discussed in this article, SqlDependency class[^] will be the best solution for you. You'll be able to share data between users in real time. Please, follow the below and all related links.
SqlDependency in an ASP.NET Application[^]


这篇关于让多个用户访问相同的基于asp.net的会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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