通过静态对象的静态属性访问asp.net会话变量是否安全?通过静态对象的静态属性访问asp.net会话变量是否安全?
这里是我的意思是:
public static class SessionHelper
{
public static int Age
{
get
{
return (int)HttpContext.Current.Session["Age"];
}
set
{
HttpContext.Current.Session["Age"] = value;
}
}
public static string Name
{
get
{
return (string)HttpContext.Current.Session["Name"];
}
set
{
HttpContext.Current.Session["Name"] = value;
}
}
}
有没有可能是用户A可以访问用户B的会话数据的这种方式?
HttpContext.Current从Thread.CurrentThread获取上下文,以防万一您想知道它是如何工作的。 – Greg 2010-05-10 16:17:18