Far*_*nov 5 .net c# asp.net session
我有一个ASP.NET应用程序,平均可以同时由120-140个用户访问.我使用Session来获取和设置用户特定信息.为了方便起见,我有一个静态的类调用CurrentSession,它有一个名为UserInfo:
public static class CurrentSession{
public static UserInfo{
get{return HttpContext.Current.Session["userInfo"]!=null?(UserInfo)HttpContext.Current.Session["userInfo"]:null;}
set{HttpContext.Current.Session["userInfo"]=value;}
}
//And other properties
}
Run Code Online (Sandbox Code Playgroud)
每当我需要当前用户的信息时,我就会这样做:
CurrentSession.UserInfo;
Run Code Online (Sandbox Code Playgroud)
最近我遇到了检索错误用户信息的情况.我的方法中是否存在可能导致Session冲突的问题?
| 归档时间: |
|
| 查看次数: |
541 次 |
| 最近记录: |