我的应用程序是asp经典和asp.net页面的混合。在web.config中,sessionState模式是StateServer,因为我在IIS中允许多个线程。因此,当我尝试从不同的browser \ machines访问应用程序时,Application状态变量中的值对于每个浏览器都是不同的。 我错过了web.config中的任何设置吗?
Application.Lock();
var sessionId = Session.SessionID;
var sessionIDACC = new String(Application("SessionIDACC"));
if (sessionIDACC == undefined || sessionIDACC == 'undefined')
{
Application("SessionIDACC") = sessionId;
sessionIDACC = new String(Application("SessionIDACC"));
Response.Write("Added by : " + sessionId);
}
else
{
if (sessionId != sessionIDACC)
Response.Write("Application is locked by : " + sessionIDACC);
else
Response.Write("You are using it! your id is : " + sessionIDACC);
}
Application.Unlock();