c# - 多个用户登录时,Session["variable"] 被覆盖
问题描述
我面临一个问题HttpContext.Current.Session["variable"]
。当多个用户在同一网络中同时登录我的 Web 应用程序时,它会被覆盖。该应用程序托管在 Windows Azure 上。
我获取登录用户的方法是这样的:
public static string GetLoginUser()
{
Login login = (Login)HttpContext.Current.Session["Login"];
return login.User;
}
当 2 个或更多用户在不同的计算机和不同的会话中使用该应用程序时,其中一个Session["Login"]
优先于其他所有。但它不违背Session["variable"]
范围?
解决方案
推荐阅读
- zend-framework - 在自定义目录路径中重新分配模板
- libgdx - font.draw() 在第一次调用时正常工作,但在第二次调用时不能正常工作
- image - Libgdx 着色器加过滤器
- spring-boot - 没有 OAuth 的 Spring 安全 JWT
- wordpress - 按以字符开头的术语过滤 tax_query
- java - 将 ArrayList 值传输到另一个 ArrayList 但每个值都与 String 连接
- javascript - HTML 表单转 JSON
- spring - 是否有任何针对嵌入式数据存储的 Spring Boot Data Reactive Starter?
- c - 在文本文件中读取最多两行的问题,C
- sql - 在 case 语句问题中使用 when exists