【发布时间】:2014-03-20 20:01:20
【问题描述】:
我的网络应用程序中有 2 个会话
这是我如何声明我的会话:
全球.asax
protected void Session_Start(object sender, EventArgs e)
{
Session["login"] = "";
Session["loginName"] = "Login";
}
Web.config
<sessionState mode="InProc" cookieless="true" timeout="3600" /> <!--set the session timeout in minutes -->
会话类:
public class clsSession
{
//declare sessions
private static object cardCode;
private static object cardName;
//get/set Login id session
public static string LoginIdSession
{
get
{
cardCode = HttpContext.Current.Session["login"];
return cardCode == null ? "" : (string)cardCode;
}
set
{
HttpContext.Current.Session["login"] = value;
}
}
public static string LoginNameSession
{
get
{
cardName = HttpContext.Current.Session["loginName"];
return cardName == null ? "Login" : (string)cardName;
}
set
{
HttpContext.Current.Session["loginName"] = value;
}
}
}
问题是 2 个会话在超时前过期!
谢谢
【问题讨论】:
-
“这 2 个会话在超时前过期” - 你怎么知道?