session| problem sessionstate timeout), its main reasons are three kinds.
One: Some kill virus software will go to scan your Web.config file, at that time session affirmation drops, this is Microsoft's saying.
Two: Inside the program has let session loses the code, and the server memory is insufficient to produce.
Third: The program has frames page and cross domain situation.
The first solution is to make the virus-killing software screen scan the web.config file (not to edit it when the program is running)
The second is to check whether the code has Session.Abandon () or not.
The third is to start the ASP.net State Service in the window service.
Http://community.csdn.net/Expert/topic/3100/3100218.xml?temp=.4426386
It is also possible that you changed the file during the test, the website.
I've tested it, no problem! The test procedure is as follows:
protected void Application_Start (Object sender, EventArgs e)
?? {
??? SqlConnection con = new SqlConnection ("server=localhost;database=yourdatabase;uid=sa;pwd=;");
??? SqlCommand cmd = new SqlCommand (string. Format ("INSERT INTO table1 (c) VALUES (' {0} ')", "Application_Start" +datetime.now.tolongtimestring () + "Application ID" + Application.tostring ()), con);
??? Con. Open ();
??? Cmd. ExecuteNonQuery ();
??? Con. Close ();
??}
?
?? protected void Session_Start (Object sender, EventArgs e)
?? {
??? SqlConnection con = new SqlConnection ("server=localhost;database=yourdatabase;uid=sa;pwd=;");
??? SqlCommand cmd = new SqlCommand (string. Format ("INSERT INTO table1 (c) VALUES (' {0} ')", "Session_Start" +datetime.now.tolongtimestring () + "sessionid=" + Session.SessionID), con);
??? Con. Open ();
??? Cmd. ExecuteNonQuery ();
??? Con. Close ();
??}
?? protected void Application_BeginRequest (Object sender, EventArgs e)
?? {
??? SqlConnection con = new SqlConnection ("server=localhost;database=yourdatabase;uid=sa;pwd=;");
??? SqlCommand cmd = new SqlCommand (string. Format ("INSERT INTO table1 (c) VALUES (' {0} ')", "Application_BeginRequest" +datetime.now.tolongtimestring ()), con);
??? Con. Open ();
??? Cmd. ExecuteNonQuery ();
??? Con. Close ();
??}
?? protected void Application_EndRequest (Object sender, EventArgs e)
?? {
??? SqlConnection con = new SqlConnection ("server=localhost;database=yourdatabase;uid=sa;pwd=;");
??? SqlCommand cmd = new SqlCommand (string. Format ("INSERT INTO table1 (c) VALUES (' {0} ')", "Application_EndRequest" +datetime.now.tolongtimestring ()), con);
??? Con. Open ();
??? Cmd. ExecuteNonQuery ();
??? Con. Close ();
??}
?? protected void Application_AuthenticateRequest (Object sender, EventArgs e)
?? {
??}
?? protected void Application_Error (Object sender, EventArgs e)
?? {
??}
?? protected void Session_End (Object sender, EventArgs e)
?? {
??? SqlConnection con = new SqlConnection ("server=localhost;database=yourdatabase;uid=sa;pwd=;");
??? SqlCommand cmd = new SqlCommand (string. Format ("INSERT INTO table1 (c) VALUES (' {0} ')", "Session_End" +datetime.now.tolongtimestring () + "sessionid=" + Session.SessionID), con);
??? Con. Open ();
??? Cmd. ExecuteNonQuery ();
??? Con. Close ();
??}
?? protected void Application_End (Object sender, EventArgs e)
?? {
??? SqlConnection con = new SqlConnection ("server=localhost;database=yourdatabase;uid=sa;pwd=;");
??? SqlCommand cmd = new SqlCommand (string. Format ("INSERT INTO table1 (c) VALUES (' {0} ')", "Application_End" +datetime.now.tolongtimestring ()), con);
??? Con. Open ();
??? Cmd. ExecuteNonQuery ();
??? Con. Close ();
??}
All the code is in global.